Skip to main content
GET
/
api
/
v1
/
costs
Get costs
curl --request GET \
  --url https://api.myrouter.example/api/v1/costs \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "period_start": "2023-11-07T05:31:56Z",
      "period_end": "2023-11-07T05:31:56Z",
      "amount": {
        "value": "<string>",
        "currency": "<string>"
      },
      "line_item": "<string>",
      "model": "<string>",
      "api_key_hash": "<string>"
    }
  ],
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-request-id
string

Optional caller request id.

Query Parameters

start_time
string<date-time>
required

Cost report start.

end_time
string<date-time>
required

Cost report end.

granularity
enum<string>

Cost granularity.

Available options:
hour,
day
group_by
enum<string>

Optional grouping.

Available options:
model,
api_key,
endpoint
api_key_hash
string

Optional public key filter.

Response

Get costs response.

data
object[]
required

Customer charge buckets.

request_id
string

Request id.