Files
openrouter-python-sdk-retry…/docs/operations/getgenerationdata.md
T
OpenRouter Team 13d706e274 Commits included in this export:
- 35d4e3137846cf3e0a5800e012692818f0dfe309
  - b2f10545419cea6b8a12c509f41ec4bd3937af0c
  - 2dbb7d9612a6e699caa91f334ad105dbde6442ee
  - 50539a3577b5a7e925b756f6bb87744052701215
  - 2cdbe64441ce4435ea0a1ff9127472e815fdaccf
  - f35bb49a8b788937fa61c0cf4591b14f2bc8b217
  - 08a37babde9ad8df5e24e0cd865d3292b1627464
  - 7ddc8e1ed230ca489bc11a5e14696c209ea76349
  - ad31290f38f3f02627f3e1953f1d7cf3e06159a5
  - fb7f764b500618e322f56d49997fbcfaebba7e39
  - 4306c032b9b4f3cfefeacdd3d243b0336f3b2f15

GitOrigin-RevId: 35d4e3137846cf3e0a5800e012692818f0dfe309
2026-03-17 02:59:58 +00:00

15 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
router Nullable[str] ✔️ Router used for the request (e.g., openrouter/auto) openrouter/auto
provider_responses List[operations.ProviderResponse] ✔️ List of provider responses for this generation, including fallback attempts
user_agent Nullable[str] ✔️ User-Agent header from the request
http_referer Nullable[str] ✔️ Referer header from the request