Skip to main content
GET
/
orgs
/
{org_id}
/
projects
/
{project_id}
/
analytics
/
credits
cURL
curl --request GET \
  --url https://api.timbal.ai/orgs/{org_id}/projects/{project_id}/analytics/credits \
  --header 'Authorization: Bearer <token>'
{
  "bins": [
    {
      "costs": [
        {
          "credits": 123,
          "id": 123,
          "name": "<string>",
          "unit": "<string>",
          "usd": 123
        }
      ],
      "interval_ends_at": 123,
      "interval_starts_at": 123
    }
  ],
  "from": 123,
  "group_by": "minute",
  "to": 123
}
Only project admins can call this endpoint. Each response returns at most 1440 time bins; there is no pagination. You may omit group_by, from, and/or to — the server applies defaults — and the JSON body includes group_by, from, and to so you can see the bin size and range that were actually used.

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required
project_id
string
required

Query Parameters

group_by
enum<string>

Bucket size for aggregation (minute, hour, or day).

Available options:
minute,
hour,
day
from
integer<int64> | null

Inclusive range start (epoch milliseconds). Defaults: 1h / 1d / 30d before to by group_by.

to
integer<int64> | null

Exclusive range end (epoch milliseconds). Defaults to now.

user_id
string | null

Restrict to a specific user’s runs.

Response

Credits analytics

bins
object[]
required
from
integer<int64>
required
group_by
enum<string>
required
Available options:
minute,
hour,
day
to
integer<int64>
required