GetGenerationData - Go SDK

GetGenerationData type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

Generation data

Fields

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