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
AppIDint64✔️ID of the app that made the request12345
CacheDiscountfloat64✔️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
GenerationTimefloat64✔️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
Latencyfloat64✔️Total latency in milliseconds1250
Modelstring✔️Model used for the generationsao10k/l3-stheno-8b
ModerationLatencyfloat64✔️Moderation latency in milliseconds50
NativeFinishReason*string✔️Native finish reason as reported by providerstop
NativeTokensCachedint64✔️Native cached tokens as reported by provider3
NativeTokensCompletionint64✔️Native completion tokens as reported by provider25
NativeTokensCompletionImagesint64✔️Native completion image tokens as reported by provider0
NativeTokensPromptint64✔️Native prompt tokens as reported by provider10
NativeTokensReasoningint64✔️Native reasoning tokens as reported by provider5
NumInputAudioPromptint64✔️Number of audio inputs in the prompt0
NumMediaCompletionint64✔️Number of media items in the completion0
NumMediaPromptint64✔️Number of media items in the prompt1
NumSearchResultsint64✔️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
TokensCompletionint64✔️Number of tokens in the completion25
TokensPromptint64✔️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
UpstreamInferenceCostfloat64✔️Cost charged by the upstream provider0.0012
Usagefloat64✔️Usage amount in USD0.0015
UserAgent*string✔️User-Agent header from the request