mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-29 11:23:49 +08:00
Auto-generated Python SDK for OpenRouter API, providing comprehensive client library with: - Chat completions and streaming support - Embeddings API - Model and provider information - API key management - Analytics and usage tracking - OAuth authentication flows - Full type hints and error handling
52 KiB
52 KiB
OpenResponsesNonStreamingResponse
Complete non-streaming response from the Responses API
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
id |
str | ✔️ | N/A | |
object |
models.Object | ✔️ | N/A | |
created_at |
float | ✔️ | N/A | |
model |
str | ✔️ | N/A | |
status |
Optional[models.OpenAIResponsesResponseStatus] | ➖ | N/A | |
output |
List[models.ResponsesOutputItem] | ✔️ | N/A | |
user |
OptionalNullable[str] | ➖ | N/A | |
output_text |
Optional[str] | ➖ | N/A | |
prompt_cache_key |
OptionalNullable[str] | ➖ | N/A | |
safety_identifier |
OptionalNullable[str] | ➖ | N/A | |
error |
Nullable[models.ResponsesErrorField] | ✔️ | Error information returned from the API | { "code": "rate_limit_exceeded", "message": "Rate limit exceeded. Please try again later." } |
incomplete_details |
Nullable[models.OpenAIResponsesIncompleteDetails] | ✔️ | N/A | |
usage |
Optional[models.OpenResponsesUsage] | ➖ | Token usage information for the response | { "input_tokens": 10, "output_tokens": 25, "total_tokens": 35, "input_tokens_details": { "cached_tokens": 0 }, "output_tokens_details": { "reasoning_tokens": 0 }, "cost": 0.0012, "cost_details": { "upstream_inference_cost": null, "upstream_inference_input_cost": 0.0008, "upstream_inference_output_cost": 0.0004 } } |
max_tool_calls |
OptionalNullable[float] | ➖ | N/A | |
top_logprobs |
Optional[float] | ➖ | N/A | |
max_output_tokens |
OptionalNullable[float] | ➖ | N/A | |
temperature |
Nullable[float] | ✔️ | N/A | |
top_p |
Nullable[float] | ✔️ | N/A | |
instructions |
Nullable[models.OpenAIResponsesInputUnion] | ✔️ | N/A | |
metadata |
Dict[str, str] | ✔️ | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | { "user_id": "123", "session_id": "abc-def-ghi" } |
tools |
List[models.OpenResponsesNonStreamingResponseToolUnion] | ✔️ | N/A | |
tool_choice |
models.OpenAIResponsesToolChoiceUnion | ✔️ | N/A | |
parallel_tool_calls |
bool | ✔️ | N/A | |
prompt |
OptionalNullable[models.OpenAIResponsesPrompt] | ➖ | N/A | |
background |
OptionalNullable[bool] | ➖ | N/A | |
previous_response_id |
OptionalNullable[str] | ➖ | N/A | |
reasoning |
OptionalNullable[models.OpenAIResponsesReasoningConfig] | ➖ | N/A | |
service_tier |
OptionalNullable[models.OpenAIResponsesServiceTier] | ➖ | N/A | |
store |
Optional[bool] | ➖ | N/A | |
truncation |
OptionalNullable[models.OpenAIResponsesTruncation] | ➖ | N/A | |
text |
Optional[models.ResponseTextConfig] | ➖ | Text output configuration including format and verbosity | { "format": { "type": "text" }, "verbosity": "medium" } |