API pública

Listar los costes de modelos

Model API key required. Devuelve los intervalos diarios UTC de coste de modelos para el ámbito visible de la clave API autenticada. Si se omite `group_by[]`, se devuelven los totales diarios.

GET
/public/v1/model-costs

Model API key required. Use apikey-...; management keys are not accepted. Returns UTC daily model cost buckets for the authenticated API key's visible scope. Omitting group_by[] returns total daily buckets.

Authorization

ModelKeyBearer
AuthorizationBearer <token>

Model API key required. Send Authorization: Bearer apikey-....

In: header

Query Parameters

start_date*string

Inclusive UTC start date in YYYY-MM-DD format.

Formatdate
end_date*string

Exclusive UTC end date in YYYY-MM-DD format. The range can cover at most 180 daily buckets.

Formatdate
scope?string

Visibility scope. self reads usage from the authenticated user's API keys. account requires account-level billing read permission.

Default"self"

Value in

  • "self"
  • "account"
group_by[]?array<>

Repeated grouping parameter. Omit to return total daily buckets. Supported sets are model_type, model, api_key, and model plus api_key. Comma-delimited values are not accepted.

Itemsitems <= 3
model_types[]?array<>

Repeated model type filter. Omit to include text, image, and video.

Itemsitems <= 3
model_ids[]?array<string>

Repeated model ID filter. At most 100 IDs.

Itemsitems <= 100
api_key_ids[]?array<string>

Repeated API key public ID filter. Use the id (ak_...) returned by POST /public/v1/api-keys. Save it at creation; the key field (apikey-...) is the authentication secret, not this filter value.

Itemsitems <= 100
limit?integer

Maximum number of grouped rows to return.

Range1 <= value <= 1000
Default100
page?string

Opaque cursor from the previous response's next_page. Pass it back unchanged.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/public/v1/model-costs?start_date=2026-05-01&end_date=2026-05-08&group_by%5B%5D=model&group_by%5B%5D=api_key&model_types%5B%5D=text&model_types%5B%5D=image&model_ids%5B%5D=deepseek-v3&api_key_ids%5B%5D=ak_abc123"
{  "object": "list",  "scope": "account",  "data": [    {      "object": "model_cost.bucket",      "date": "2026-05-01",      "start_at": "2026-05-01T00:00:00Z",      "end_at": "2026-05-02T00:00:00Z",      "covered_until": "2026-05-02T00:00:00Z",      "partial": false,      "results": [        {          "object": "model_cost.result",          "amount": {            "value": "0.240000",            "currency": "usd"          }        }      ]    }  ],  "has_more": false,  "next_page": null,  "request_id": "req_123"}

Last updated on