Analytics
API requests per credential per day
Each API key and OAuth app's requests and errors per UTC day, oldest first.
GET
/v1/usageTL;DR
| Question | Answer |
|---|---|
| What does it do? | API requests per credential per day. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | days in the query string. |
| What does it return? | Status 200 with a body of type Usage. |
| In the SDK? | flung.analytics.usage() |
| What can go wrong? | 401 Missing, unknown, revoked or expired API key; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape. |
What it does
Each API key and OAuth app's requests and errors per UTC day, oldest first. Kept for 90 days.
Example
bash
curl -X GET 'https://api.flung.dev/v1/usage' \ --header "Authorization: Bearer $FLUNG_API_KEY"ts
import { Flung } from '@flung.dev/sdk'
const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })const result = await flung.analytics.usage()js
const response = await fetch('https://api.flung.dev/v1/usage', { method: 'GET', headers: { 'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`, },})if (!response.ok) throw new Error((await response.json()).error.message)const result = await response.json()A successful answer looks like this:
json
{ "data": [ { "credential": "key:key_aaaaaaaaaaaaaaaaaaaaaaaa", "day": "2026-10-29", "requests": 1, "errors": 1 } ]}Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
days | integer | no |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The counts. | Usage |
| 401 | Missing, unknown, revoked or expired API key. | Error |
| 422 | The request failed validation. | Error |
| 429 | Too many requests for this credential; wait for retry-after seconds. | Error |
Response body
A 200 answer has the type Usage.
| Field | Type | Required | Description |
|---|---|---|---|
data | object[] | yes | |
data[].credential | string | yes | key:<api key id> or app:<OAuth client id>. |
data[].day | string | yes | |
data[].requests | integer | yes | |
data[].errors | integer | yes | Answers of 400 or more, rate limits included. |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint |
| Schemas | Every request and response type |
| Errors | Every error code and what to do about it |