GatewayGeneration Lookup

Generation Lookup

Every request returns a unique generation ID in the X-Generation-Id header. Use it to look up full request details.

Endpoint

GET /v1/generation?id=gen_01ARZ3NDEKTSV4RRFFQ69G5FAV

Requires authentication. Returns details only for requests made by the authenticated user.

Example

curl -H "Authorization: Bearer sk-tan-YOUR_KEY" \
  "https://router.tangle.tools/v1/generation?id=gen_01ARZ3NDEKTSV4RRFFQ69G5FAV"

Response

{
  "data": {
    "id": "gen_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "total_cost": 0.00123,
    "usage": 0.00123,
    "created_at": "2026-04-10T12:00:00.000Z",
    "model": "anthropic/claude-sonnet-4-6",
    "is_byok": false,
    "provider_name": "anthropic",
    "streamed": true,
    "latency": 200,
    "generation_time": 1500,
    "tokens_prompt": 100,
    "tokens_completion": 50,
    "native_tokens_cached": 80,
    "native_tokens_reasoning": 0,
    "status": "success",
    "routing_trace": {
      "planningReasoning": "ZDR requested: filtering to 13 ZDR providers",
      "modelAttempts": [...],
      "totalLatencyMs": 1500
    },
    "cache_hit": false
  }
}

Fields

FieldDescription
idGeneration ID (gen_<ulid>)
total_costTotal cost in USD
modelModel that served the request
is_byokWhether BYOK credentials were used
provider_nameProvider that served the request
streamedWhether the request used streaming
latencyTime to first token (ms)
generation_timeTotal generation time (ms)
tokens_prompt / tokens_completionToken counts
native_tokens_cachedTokens served from provider cache
native_tokens_reasoningReasoning tokens (o1/o3/o4 models)
routing_traceFull routing attempt history
cache_hitWhether response was served from gateway cache