Skip to main content
The Go SDK and docs are currently in beta. Report issues on GitHub.
Generation data

Fields

FieldTypeRequiredDescriptionExample
APIType*components.APIType:heavy_check_mark:Type of API used for the generation
AppID*int64:heavy_check_mark:ID of the app that made the request12345
CacheDiscount*float64:heavy_check_mark:Discount applied due to caching0.0002
Cancelled*bool:heavy_check_mark:Whether the generation was cancelledfalse
CreatedAtstring:heavy_check_mark:ISO 8601 timestamp of when the generation was created2024-07-15T23:33:19.433273+00:00
ExternalUser*string:heavy_check_mark:External user identifieruser-123
FinishReason*string:heavy_check_mark:Reason the generation finishedstop
GenerationTime*float64:heavy_check_mark:Time taken for generation in milliseconds1200
HTTPReferer*string:heavy_check_mark:Referer header from the request
IDstring:heavy_check_mark:Unique identifier for the generationgen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
IsByokbool:heavy_check_mark:Whether this used bring-your-own-keyfalse
Latency*float64:heavy_check_mark:Total latency in milliseconds1250
Modelstring:heavy_check_mark:Model used for the generationsao10k/l3-stheno-8b
ModerationLatency*float64:heavy_check_mark:Moderation latency in milliseconds50
NativeFinishReason*string:heavy_check_mark:Native finish reason as reported by providerstop
NativeTokensCached*int64:heavy_check_mark:Native cached tokens as reported by provider3
NativeTokensCompletion*int64:heavy_check_mark:Native completion tokens as reported by provider25
NativeTokensCompletionImages*int64:heavy_check_mark:Native completion image tokens as reported by provider0
NativeTokensPrompt*int64:heavy_check_mark:Native prompt tokens as reported by provider10
NativeTokensReasoning*int64:heavy_check_mark:Native reasoning tokens as reported by provider5
NumFetches*int64:heavy_check_mark:Number of web fetches performed0
NumInputAudioPrompt*int64:heavy_check_mark:Number of audio inputs in the prompt0
NumMediaCompletion*int64:heavy_check_mark:Number of media items in the completion0
NumMediaPrompt*int64:heavy_check_mark:Number of media items in the prompt1
NumSearchResults*int64:heavy_check_mark:Number of search results included5
Originstring:heavy_check_mark:Origin URL of the requesthttps://openrouter.ai/
PresetID*string:heavy_check_mark:ID of the preset used for this generation, null if no preset was useda9e8d400-592a-494f-908c-375efa66cafd
ProviderName*string:heavy_check_mark:Name of the provider that served the requestInfermatic
ProviderResponses[]components.ProviderResponse:heavy_check_mark:List of provider responses for this generation, including fallback attempts
RequestIDoptionalnullable.OptionalNullable[string]:heavy_minus_sign:Unique identifier grouping all generations from a single API requestreq-1727282430-aBcDeFgHiJkLmNoPqRsT
ResponseCacheSourceIDoptionalnullable.OptionalNullable[string]:heavy_minus_sign:If this generation was served from response cache, contains the original generation ID. Null otherwise.
Router*string:heavy_check_mark:Router used for the request (e.g., openrouter/auto)openrouter/auto
ServiceTier*string:heavy_check_mark:Service tier the upstream provider reported running this request on, or null if it did not report one.priority
SessionIDoptionalnullable.OptionalNullable[string]:heavy_minus_sign:Session identifier grouping multiple generations in the same session
Streamed*bool:heavy_check_mark:Whether the response was streamedtrue
TokensCompletion*int64:heavy_check_mark:Number of tokens in the completion25
TokensPrompt*int64:heavy_check_mark:Number of tokens in the prompt10
TotalCostfloat64:heavy_check_mark:Total cost of the generation in USD0.0015
UpstreamID*string:heavy_check_mark:Upstream provider’s identifier for this generationchatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
UpstreamInferenceCost*float64:heavy_check_mark:Cost charged by the upstream provider0.0012
Usagefloat64:heavy_check_mark:Usage amount in USD0.0015
UserAgent*string:heavy_check_mark:User-Agent header from the request
WebSearchEngine*string:heavy_check_mark:The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel)exa