ChatResult - Python SDK

ChatResult method reference

The Python SDK and docs are currently in beta. Report issues on GitHub.

Chat completion response

Fields

FieldTypeRequiredDescriptionExample
choicesList[components.ChatChoice]✔️List of completion choices
createdint✔️Unix timestamp of creation1677652288
idstr✔️Unique completion identifierchatcmpl-123
modelstr✔️Model used for completionopenai/gpt-4
objectcomponents.ChatResultObject✔️N/A
openrouter_metadataOptional[components.OpenRouterMetadata]N/A{"attempt": 1,"endpoints": {"available": [{"model": "openai/gpt-4o","provider": "OpenAI","selected": true}
],
“total”: 1<br />},
“is_byok”: false,
“region”: “iad”,
“requested”: “openai/gpt-4o”,
“strategy”: “direct”,
“summary”: “available=1, selected=OpenAI”
}
service_tierOptionalNullable[str]The service tier used by the upstream provider for this requestdefault
system_fingerprintNullable[str]✔️System fingerprintfp_44709d6fcb
usageOptional[components.ChatUsage]Token usage statistics{"completion_tokens": 15,"completion_tokens_details": {"reasoning_tokens": 5},
“cost”: 0.0012,
“cost_details”: {"upstream_inference_completions_cost": 0.0004,"upstream_inference_cost": null,"upstream_inference_prompt_cost": 0.0008},
“is_byok”: false,
“prompt_tokens”: 10,
“prompt_tokens_details”: {"cached_tokens": 2},
“total_tokens”: 25<br />}