For the complete documentation index, see llms.txt. This page is also available as Markdown.

Organization usage

List Organization Usage

get

List the caller's organization's usage logs, most recent first.

The tenant-scoped counterpart of GET /api/v1/usage: same filters, same bare JSON array, same separate /count for a paginator's total, confined to what the caller's membership lets them see. Scope is never a parameter here.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
start_datestring · date-time · nullableOptional

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

statusstring · nullableOptional

Filter to a single status: 'success', 'error', or 'absorbed' (an attempt a routing policy recovered from, excluded from error_count and request_count)

status_codeinteger · nullableOptional

Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly

modelstring[] · max: 50 · nullableOptional

Filter to one or more models; repeatable (model=a&model=b). Several values match any of them. At most 50 per call.

endpointstring · nullableOptional

Filter to a single endpoint (e.g. '/v1/chat/completions')

providerstring · nullableOptional

Filter to a single provider (e.g. 'openai')

sourcestring · nullableOptional

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

source_labelstring · nullableOptional

Filter to a single session (source_label): the session's trace id on a gateway request that named one, or the session/project label imported usage carried

tagstring[] · max: 50 · nullableOptional

Filter by a request tag (what a request sent in its metadata), as key:value. Repeatable: values for the same key match any of them, and different keys must all match. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.

pricedboolean · nullableOptional

Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.

toolstring · enum · nullableOptional

Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, web_fetch, code_execution) matches that tool specifically.

Possible values:
counts_toward_budgetboolean · nullableOptional

Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key

request_group_idstring[] · max: 1000 · nullableOptional

Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.

workspace_idstring · uuid · nullableOptional

Only usage recorded in this workspace.

skipintegerOptionalDefault: 0
limitinteger · min: 1 · max: 1000OptionalDefault: 100
Responses
200

Successful Response

application/json

A single usage log entry.

api_key_idstring · nullableRequired
api_key_namestring · nullableOptional
attempt_countinteger · nullableOptional
attempt_positioninteger · nullableOptional
billing_metersany of · nullableRequired
or
bulk_editablebooleanRequired
cache_read_tokensinteger · nullableRequired
cache_write_1h_tokensinteger · nullableRequired
cache_write_tokensinteger · nullableRequired
completion_tokensinteger · nullableRequired
costnumber · nullableRequired
counts_toward_budgetbooleanRequired
endpointstringRequired
error_messagestring · nullableRequired
idstringRequired
latency_msinteger · nullableRequired
modelstringRequired
policy_namestring · nullableOptional
prompt_tokensinteger · nullableRequired
providerstring · nullableRequired
provider_latency_msinteger · nullableRequired
reasoning_tokensinteger · nullableOptional
request_group_idstring · nullableOptional
selection_reasonstring · nullableOptional
sourcestringRequired
source_labelstring · nullableRequired
statusstringRequired
status_codeinteger · nullableRequired
stream_cut_bystring · enum · nullableOptionalPossible values:
timestampstringRequired
total_tokensinteger · nullableRequired
user_aliasstring · nullableOptional
user_idstring · nullableRequired
get/api/v1/organizations/me/usage
GET /api/v1/organizations/me/usage HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
[
  {
    "api_key_id": "text",
    "api_key_name": "text",
    "attempt_count": 1,
    "attempt_position": 1,
    "billing_meters": {
      "tools": {
        "ANY_ADDITIONAL_PROPERTY": {
          "billed": 1,
          "errors": 1,
          "unit_rate": 1,
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "bulk_editable": true,
    "cache_read_tokens": 1,
    "cache_write_1h_tokens": 1,
    "cache_write_tokens": 1,
    "completion_tokens": 1,
    "cost": 1,
    "counts_toward_budget": true,
    "endpoint": "text",
    "error_message": "text",
    "id": "text",
    "latency_ms": 1,
    "model": "text",
    "policy_name": "text",
    "pricing_breakdown": [
      {
        "cost": 1,
        "label": "text",
        "meter": "text",
        "unit_rate": 1,
        "units": 1,
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "prompt_tokens": 1,
    "provider": "text",
    "provider_latency_ms": 1,
    "reasoning_tokens": 1,
    "request_group_id": "text",
    "selection_reason": "text",
    "source": "text",
    "source_label": "text",
    "status": "text",
    "status_code": 1,
    "stream_cut_by": "provider",
    "tags": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    },
    "timestamp": "text",
    "total_tokens": 1,
    "user_alias": "text",
    "user_id": "text"
  }
]

Count Organization Usage

get

Total rows matching these filters, within the caller's scope.

Serves the paginator's "N of M" beside the list above, and is scoped the same way, so the total can never describe more rows than the list will show.

Unlike the operator's GET /api/v1/usage/count, counts_toward_budget=false is not narrowed to imported rows here: that narrowing sizes the bulk mutations, and this surface has none. So this total keeps matching the list beside it.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
start_datestring · date-time · nullableOptional

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

statusstring · nullableOptional

Filter to a single status: 'success', 'error', or 'absorbed' (an attempt a routing policy recovered from, excluded from error_count and request_count)

status_codeinteger · nullableOptional

Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly

modelstring[] · max: 50 · nullableOptional

Filter to one or more models; repeatable (model=a&model=b). Several values match any of them. At most 50 per call.

endpointstring · nullableOptional

Filter to a single endpoint (e.g. '/v1/chat/completions')

providerstring · nullableOptional

Filter to a single provider (e.g. 'openai')

sourcestring · nullableOptional

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

source_labelstring · nullableOptional

Filter to a single session (source_label): the session's trace id on a gateway request that named one, or the session/project label imported usage carried

tagstring[] · max: 50 · nullableOptional

Filter by a request tag (what a request sent in its metadata), as key:value. Repeatable: values for the same key match any of them, and different keys must all match. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.

pricedboolean · nullableOptional

Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.

toolstring · enum · nullableOptional

Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, web_fetch, code_execution) matches that tool specifically.

Possible values:
counts_toward_budgetboolean · nullableOptional

Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key

request_group_idstring[] · max: 1000 · nullableOptional

Filter to the rows of one or more request groups; repeatable (request_group_id=a&request_group_id=b). A routed request writes one row per attempt, all sharing a request_group_id, so this returns a request's whole plan: its absorbed attempts and the attempt that served it. Ignore ordering by timestamp and read attempt_position to reconstruct the plan. At most 1000 ids per call.

workspace_idstring · uuid · nullableOptional

Only usage recorded in this workspace.

Responses
200

Successful Response

application/json

Total number of usage logs matching a set of filters.

totalintegerRequired
get/api/v1/organizations/me/usage/count
GET /api/v1/organizations/me/usage/count HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "total": 1
}

Organization Usage Series

get

Time series split by one dimension, for the caller's organization.

The tenant-scoped counterpart of GET /api/v1/usage/series, and kept in lockstep with the summary above for the reason that endpoint gives: the dashboard serializes one filter object for both, so a filter one of them ignored would make the stacked chart disagree with the tiles beside it.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
group_bystring · enumRequired

Dimension to split the series by

Possible values:
start_datestring · date-time · nullableOptional

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

statusstring · nullableOptional

Filter to a single status: 'success', 'error', or 'absorbed' (an attempt a routing policy recovered from, excluded from error_count and request_count)

status_codeinteger · nullableOptional

Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly

modelstring[] · max: 50 · nullableOptional

Filter to one or more models; repeatable (model=a&model=b). Several values match any of them. At most 50 per call.

endpointstring · nullableOptional

Filter to a single endpoint (e.g. '/v1/chat/completions')

providerstring · nullableOptional

Filter to a single provider (e.g. 'openai')

sourcestring · nullableOptional

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

source_labelstring · nullableOptional

Filter to a single session (source_label): the session's trace id on a gateway request that named one, or the session/project label imported usage carried

tagstring[] · max: 50 · nullableOptional

Filter by a request tag (what a request sent in its metadata), as key:value. Repeatable: values for the same key match any of them, and different keys must all match. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.

pricedboolean · nullableOptional

Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.

toolstring · enum · nullableOptional

Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, web_fetch, code_execution) matches that tool specifically.

Possible values:
counts_toward_budgetboolean · nullableOptional

Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key

workspace_idstring · uuid · nullableOptional

Only usage recorded in this workspace.

bucketstring · enumOptional

Time-series granularity: 'hour' or 'day'

Default: dayPossible values:
Responses
200

Successful Response

application/json

A per-group time series for the dashboard's stacked charts.

groups ranks the window's top groups by spend (plus the reconciling other fold), in the order a chart should stack and color them; points is sparse (only populated cells), keyed by canonical UTC bucket_start.

bucketstring · enumRequiredPossible values:
end_datestringRequired
group_bystring · enumRequiredPossible values:
start_datestringRequired
get/api/v1/organizations/me/usage/series
GET /api/v1/organizations/me/usage/series?group_by=model HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "bucket": "hour",
  "end_date": "text",
  "group_by": "model",
  "groups": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "points": [
    {
      "bucket_start": "text",
      "cost": 1,
      "is_other": false,
      "key": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "start_date": "text"
}

Organization Usage Summary

get

Aggregate spend, tokens and request volume for the caller's organization.

The tenant-scoped counterpart of GET /api/v1/usage/summary, running the same aggregation over a narrower row set: the same bounded window, the same breakdowns, the same dimensions selector for paying only for the passes a caller reads. The breakdown by user names the people inside the caller's own scope, which is the roster they can already read.

Authorizations
Otari-KeystringRequired

Enter your API key here (sent as Otari-Key header).

Query parameters
start_datestring · date-time · nullableOptional

Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)

end_datestring · date-time · nullableOptional

Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)

user_idstring[] · max: 50 · nullableOptional

Filter to one or more users; repeatable (user_id=a&user_id=b). Several values match any of them. At most 50 per call.

statusstring · nullableOptional

Filter to a single status: 'success', 'error', or 'absorbed' (an attempt a routing policy recovered from, excluded from error_count and request_count)

status_codeinteger · nullableOptional

Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly

modelstring[] · max: 50 · nullableOptional

Filter to one or more models; repeatable (model=a&model=b). Several values match any of them. At most 50 per call.

endpointstring · nullableOptional

Filter to a single endpoint (e.g. '/v1/chat/completions')

providerstring · nullableOptional

Filter to a single provider (e.g. 'openai')

sourcestring · nullableOptional

Filter to a single provenance source (e.g. 'gateway' or 'claude_code')

source_labelstring · nullableOptional

Filter to a single session (source_label): the session's trace id on a gateway request that named one, or the session/project label imported usage carried

tagstring[] · max: 50 · nullableOptional

Filter by a request tag (what a request sent in its metadata), as key:value. Repeatable: values for the same key match any of them, and different keys must all match. At most 50 per call.

api_key_idstring[] · max: 50 · nullableOptional

Filter to one or more API key ids; repeatable (api_key_id=a&api_key_id=b). Several values match any of them. At most 50 per call.

pricedboolean · nullableOptional

Filter by token-pricing state: true = only rows whose model tokens were priced, false = only rows that still need pricing (no cost at all, or tokens that were never metered because the model had no rate). A row charged only for gateway-run tool calls still counts as needing pricing.

toolstring · enum · nullableOptional

Filter to requests that ran a gateway-run tool. 'any' matches any tool; a tool name (web_search, web_fetch, code_execution) matches that tool specifically.

Possible values:
counts_toward_budgetboolean · nullableOptional

Filter by budget participation, which is not the same question as provenance: true = only enforced gateway rows, false = every row that never touches a budget, meaning imported usage and also gateway traffic on a budget-exempt key

workspace_idstring · uuid · nullableOptional

Only usage recorded in this workspace.

bucketstring · enumOptional

Time-series granularity: 'hour' or 'day'

Default: dayPossible values:
group_by_tagstring · min: 1 · max: 64 · nullableOptional

A tag key to break spend down by, returned as by_tag. Rows that do not carry the tag group under a null key.

Responses
200

Successful Response

application/json

Aggregate spend/volume for the Usage & analytics page.

Every breakdown field is always present. One the caller excluded through dimensions comes back as an empty list, the same shape a window with no matching rows produces, so narrowing the selector never changes the schema.

bucketstring · enumRequiredPossible values:
end_datestringRequired
start_datestringRequired
get/api/v1/organizations/me/usage/summary
GET /api/v1/organizations/me/usage/summary HTTP/1.1
Otari-Key: YOUR_API_KEY
Accept: */*
{
  "bucket": "hour",
  "by_api_key": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_endpoint": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_model": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_provider": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_source": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_source_label": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_tag": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "by_tool": [
    {
      "calls": 1,
      "cost": 1,
      "errors": 1,
      "requests": 1,
      "tool": "text"
    }
  ],
  "by_user": [
    {
      "cost": 1,
      "is_other": false,
      "key": "text",
      "label": "text",
      "requests": 1,
      "tokens": 1
    }
  ],
  "end_date": "text",
  "errors_by_status_code": [
    {
      "error_class": "pricing",
      "requests": 1,
      "status_code": 1
    }
  ],
  "series": [
    {
      "bucket_start": "text",
      "cache_read_tokens": 0,
      "cache_write_tokens": 0,
      "cost": 1,
      "errors": 0,
      "input_tokens": 0,
      "output_tokens": 0,
      "requests": 1,
      "tokens": 1
    }
  ],
  "start_date": "text",
  "totals": {
    "avg_latency_ms": 1,
    "billed_input_tokens": 0,
    "billed_output_tokens": 0,
    "cache_read_tokens": 1,
    "cache_write_1h_tokens": 1,
    "cache_write_tokens": 1,
    "completion_tokens": 1,
    "cost": 1,
    "error_count": 1,
    "prompt_tokens": 1,
    "reasoning_tokens": 0,
    "request_count": 1,
    "total_tokens": 1,
    "unpriced_requests": 0
  }
}

Last updated

Was this helpful?