Files
openrouter-python-sdk-retry…/docs/operations/getgenerationdata.md
T
2025-11-13 14:21:27 -05:00

9.9 KiB

GetGenerationData

Generation data

Fields

Field Type Required Description Example
id str ✔️ Unique identifier for the generation gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
upstream_id Nullable[str] ✔️ Upstream provider's identifier for this generation chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
total_cost float ✔️ Total cost of the generation in USD 0.0015
cache_discount Nullable[float] ✔️ Discount applied due to caching 0.0002
upstream_inference_cost Nullable[float] ✔️ Cost charged by the upstream provider 0.0012
created_at str ✔️ ISO 8601 timestamp of when the generation was created 2024-07-15T23:33:19.433273+00:00
model str ✔️ Model used for the generation sao10k/l3-stheno-8b
app_id Nullable[float] ✔️ ID of the app that made the request 12345
streamed Nullable[bool] ✔️ Whether the response was streamed true
cancelled Nullable[bool] ✔️ Whether the generation was cancelled false
provider_name Nullable[str] ✔️ Name of the provider that served the request Infermatic
latency Nullable[float] ✔️ Total latency in milliseconds 1250
moderation_latency Nullable[float] ✔️ Moderation latency in milliseconds 50
generation_time Nullable[float] ✔️ Time taken for generation in milliseconds 1200
finish_reason Nullable[str] ✔️ Reason the generation finished stop
tokens_prompt Nullable[float] ✔️ Number of tokens in the prompt 10
tokens_completion Nullable[float] ✔️ Number of tokens in the completion 25
native_tokens_prompt Nullable[float] ✔️ Native prompt tokens as reported by provider 10
native_tokens_completion Nullable[float] ✔️ Native completion tokens as reported by provider 25
native_tokens_completion_images Nullable[float] ✔️ Native completion image tokens as reported by provider 0
native_tokens_reasoning Nullable[float] ✔️ Native reasoning tokens as reported by provider 5
native_tokens_cached Nullable[float] ✔️ Native cached tokens as reported by provider 3
num_media_prompt Nullable[float] ✔️ Number of media items in the prompt 1
num_input_audio_prompt Nullable[float] ✔️ Number of audio inputs in the prompt 0
num_media_completion Nullable[float] ✔️ Number of media items in the completion 0
num_search_results Nullable[float] ✔️ Number of search results included 5
origin str ✔️ Origin URL of the request https://openrouter.ai/
usage float ✔️ Usage amount in USD 0.0015
is_byok bool ✔️ Whether this used bring-your-own-key false
native_finish_reason Nullable[str] ✔️ Native finish reason as reported by provider stop
external_user Nullable[str] ✔️ External user identifier user-123
api_type Nullable[operations.APIType] ✔️ Type of API used for the generation