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

Fields

FieldTypeRequiredDescriptionExample
idstr:heavy_check_mark:Unique identifier for the generationgen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
upstream_idNullable[str]:heavy_check_mark:Upstream provider’s identifier for this generationchatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
total_costfloat:heavy_check_mark:Total cost of the generation in USD0.0015
cache_discountNullable[float]:heavy_check_mark:Discount applied due to caching0.0002
upstream_inference_costNullable[float]:heavy_check_mark:Cost charged by the upstream provider0.0012
created_atstr:heavy_check_mark:ISO 8601 timestamp of when the generation was created2024-07-15T23:33:19.433273+00:00
modelstr:heavy_check_mark:Model used for the generationsao10k/l3-stheno-8b
app_idNullable[float]:heavy_check_mark:ID of the app that made the request12345
streamedNullable[bool]:heavy_check_mark:Whether the response was streamedtrue
cancelledNullable[bool]:heavy_check_mark:Whether the generation was cancelledfalse
provider_nameNullable[str]:heavy_check_mark:Name of the provider that served the requestInfermatic
latencyNullable[float]:heavy_check_mark:Total latency in milliseconds1250
moderation_latencyNullable[float]:heavy_check_mark:Moderation latency in milliseconds50
generation_timeNullable[float]:heavy_check_mark:Time taken for generation in milliseconds1200
finish_reasonNullable[str]:heavy_check_mark:Reason the generation finishedstop
tokens_promptNullable[float]:heavy_check_mark:Number of tokens in the prompt10
tokens_completionNullable[float]:heavy_check_mark:Number of tokens in the completion25
native_tokens_promptNullable[float]:heavy_check_mark:Native prompt tokens as reported by provider10
native_tokens_completionNullable[float]:heavy_check_mark:Native completion tokens as reported by provider25
native_tokens_completion_imagesNullable[float]:heavy_check_mark:Native completion image tokens as reported by provider0
native_tokens_reasoningNullable[float]:heavy_check_mark:Native reasoning tokens as reported by provider5
native_tokens_cachedNullable[float]:heavy_check_mark:Native cached tokens as reported by provider3
num_media_promptNullable[float]:heavy_check_mark:Number of media items in the prompt1
num_input_audio_promptNullable[float]:heavy_check_mark:Number of audio inputs in the prompt0
num_media_completionNullable[float]:heavy_check_mark:Number of media items in the completion0
num_search_resultsNullable[float]:heavy_check_mark:Number of search results included5
originstr:heavy_check_mark:Origin URL of the requesthttps://openrouter.ai/
usagefloat:heavy_check_mark:Usage amount in USD0.0015
is_byokbool:heavy_check_mark:Whether this used bring-your-own-keyfalse
native_finish_reasonNullable[str]:heavy_check_mark:Native finish reason as reported by providerstop
external_userNullable[str]:heavy_check_mark:External user identifieruser-123
api_typeNullable[operations.APIType]:heavy_check_mark:Type of API used for the generation
routerNullable[str]:heavy_check_mark:Router used for the request (e.g., openrouter/auto)openrouter/auto