Go SDKAPI ReferenceOperations
GetGenerationData - Go SDK
GetGenerationData type definition
The Go SDK and docs are currently in beta. Report issues on GitHub.
Generation data
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
ID | string | ✔️ | Unique identifier for the generation | gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG |
UpstreamID | *string | ✔️ | Upstream provider’s identifier for this generation | chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946 |
TotalCost | float64 | ✔️ | Total cost of the generation in USD | 0.0015 |
CacheDiscount | float64 | ✔️ | Discount applied due to caching | 0.0002 |
UpstreamInferenceCost | float64 | ✔️ | Cost charged by the upstream provider | 0.0012 |
CreatedAt | string | ✔️ | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 |
Model | string | ✔️ | Model used for the generation | sao10k/l3-stheno-8b |
AppID | int64 | ✔️ | ID of the app that made the request | 12345 |
Streamed | *bool | ✔️ | Whether the response was streamed | true |
Cancelled | *bool | ✔️ | Whether the generation was cancelled | false |
ProviderName | *string | ✔️ | Name of the provider that served the request | Infermatic |
Latency | float64 | ✔️ | Total latency in milliseconds | 1250 |
ModerationLatency | float64 | ✔️ | Moderation latency in milliseconds | 50 |
GenerationTime | float64 | ✔️ | Time taken for generation in milliseconds | 1200 |
FinishReason | *string | ✔️ | Reason the generation finished | stop |
TokensPrompt | int64 | ✔️ | Number of tokens in the prompt | 10 |
TokensCompletion | int64 | ✔️ | Number of tokens in the completion | 25 |
NativeTokensPrompt | int64 | ✔️ | Native prompt tokens as reported by provider | 10 |
NativeTokensCompletion | int64 | ✔️ | Native completion tokens as reported by provider | 25 |
NativeTokensCompletionImages | int64 | ✔️ | Native completion image tokens as reported by provider | 0 |
NativeTokensReasoning | int64 | ✔️ | Native reasoning tokens as reported by provider | 5 |
NativeTokensCached | int64 | ✔️ | Native cached tokens as reported by provider | 3 |
NumMediaPrompt | int64 | ✔️ | Number of media items in the prompt | 1 |
NumInputAudioPrompt | int64 | ✔️ | Number of audio inputs in the prompt | 0 |
NumMediaCompletion | int64 | ✔️ | Number of media items in the completion | 0 |
NumSearchResults | int64 | ✔️ | Number of search results included | 5 |
Origin | string | ✔️ | Origin URL of the request | https://openrouter.ai/ |
Usage | float64 | ✔️ | Usage amount in USD | 0.0015 |
IsByok | bool | ✔️ | Whether this used bring-your-own-key | false |
NativeFinishReason | *string | ✔️ | Native finish reason as reported by provider | stop |
ExternalUser | *string | ✔️ | External user identifier | user-123 |
APIType | *operations.APIType | ✔️ | Type of API used for the generation | |
Router | *string | ✔️ | Router used for the request (e.g., openrouter/auto) | openrouter/auto |
ProviderResponses | []components.ProviderResponse | ✔️ | List of provider responses for this generation, including fallback attempts | |
UserAgent | *string | ✔️ | User-Agent header from the request | |
HTTPReferer | *string | ✔️ | Referer header from the request | |
RequestID | optionalnullable.OptionalNullable[string] | ➖ | Unique identifier grouping all generations from a single API request | req-1727282430-aBcDeFgHiJkLmNoPqRsT |
SessionID | optionalnullable.OptionalNullable[string] | ➖ | Session identifier grouping multiple generations in the same session |