BazaarLinkBazaarLink
Sign in
DocsAPI ReferenceSDK ReferenceAgentic UsageAI Skills
Account

Get a generation

Looks up usage and billing detail for a single request by its generation id (the id field from any compatible endpoint's response). Scoped to the API key's own user — another user's generation id returns 404, never leaking their data. The response's provider field always returns the fixed value "bazaarlink", not the actual upstream provider that was routed to.

GET/api/v1/generation

Authorizations

Authorizationrequired
string · header

API key as bearer token in the Authorization header.

Query parameters

idrequired
string

The generation id to look up, taken from the id field of any compatible endpoint's successful response.

GET /api/v1/generation
curl "https://bazaarlink.ai/api/v1/generation?id=gen-abc123" \
  -H "Authorization: Bearer $BAZAARLINK_API_KEY"
Response examples

Success. usage uses the same token-field shape as the chat endpoints (prompt_tokens/completion_tokens/total_tokens); cost_breakdown additionally splits out the subtotal and the cache discount.

{
  "data": {
    "id": "gen-abc123",
    "model": "openai/gpt-4.1",
    "provider": "bazaarlink",
    "created_at": "2026-07-27T02:00:00.000Z",
    "app_name": "my-app",
    "finish_reason": "stop",
    "status": 200,
    "duration_ms": 1840,
    "first_token_ms": 320,
    "throughput": 42.5,
    "usage": {
      "prompt_tokens": 128,
      "completion_tokens": 256,
      "total_tokens": 384,
      "prompt_tokens_details": {
        "cached_tokens": 0
      },
      "completion_tokens_details": {
        "reasoning_tokens": 0
      },
      "cost": 0.0034
    },
    "cost_breakdown": {
      "subtotal": 0.0034,
      "cache_discount": 0,
      "total": 0.0034
    }
  }
}
Support
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
Get a generation — BazaarLink API