cURL
curl --request GET \ --url https://api.specular.dev/projects/{id}/ai-gateway/usage \ --header 'Authorization: Bearer <token>'
{ "usage": [ { "id": "<string>", "projectId": "<string>", "branchId": "<string>", "model": "<string>", "requestPath": "<string>", "inputTokens": 123, "outputTokens": 123, "costUsd": 123, "requestedAt": "2023-11-07T05:31:56Z" } ], "total": 123, "limit": 123, "offset": 123 }
Bearer authentication with API key (format: Bearer sk_xxx)
Project ID
Maximum number of records to return (1-100)
1 <= x <= 100
Number of records to skip
x >= 0
AI Gateway usage records
Show child attributes
Total number of records