fix: update OpenAPI spec with router field (#32)

This commit is contained in:
Matt Apperson
2026-01-13 20:40:08 -05:00
committed by GitHub
parent f190e3f950
commit 3a40848aab
92 changed files with 2569 additions and 511 deletions
+47 -13
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management:
docChecksum: a5b3a567dd4de3ab77a9f0b23d4a9f10
docChecksum: 331e8a1f7c97c6a4a6b57eaddc80fc39
docVersion: 1.0.0
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.0.17
configChecksum: 50ef18bf69272fc09c257e3562e1b0df
releaseVersion: 0.0.18
configChecksum: 1f58284fadb5b2b9029e9ef747f2a7e9
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true
@@ -60,12 +60,18 @@ generatedFiles:
- docs/components/chaterrorerror.md
- docs/components/chatgenerationparams.md
- docs/components/chatgenerationparamsdatacollection.md
- docs/components/chatgenerationparamsimageconfig.md
- docs/components/chatgenerationparamsmaxprice.md
- docs/components/chatgenerationparamspluginautorouter.md
- docs/components/chatgenerationparamspluginfileparser.md
- docs/components/chatgenerationparamspluginmoderation.md
- docs/components/chatgenerationparamspluginresponsehealing.md
- docs/components/chatgenerationparamspluginunion.md
- docs/components/chatgenerationparamspluginweb.md
- docs/components/chatgenerationparamspreferredmaxlatency.md
- docs/components/chatgenerationparamspreferredmaxlatencyunion.md
- docs/components/chatgenerationparamspreferredminthroughput.md
- docs/components/chatgenerationparamspreferredminthroughputunion.md
- docs/components/chatgenerationparamsprovider.md
- docs/components/chatgenerationparamsresponseformatjsonobject.md
- docs/components/chatgenerationparamsresponseformatpython.md
@@ -85,6 +91,7 @@ generatedFiles:
- docs/components/chatmessagecontentitemvideovideourl.md
- docs/components/chatmessagetokenlogprob.md
- docs/components/chatmessagetokenlogprobs.md
- docs/components/chatmessagetokenlogprobtoplogprob.md
- docs/components/chatmessagetoolcall.md
- docs/components/chatmessagetoolcallfunction.md
- docs/components/chatresponse.md
@@ -126,6 +133,7 @@ generatedFiles:
- docs/components/filepath.md
- docs/components/filepathtype.md
- docs/components/forbiddenresponseerrordata.md
- docs/components/idautorouter.md
- docs/components/idfileparser.md
- docs/components/idmoderation.md
- docs/components/idresponsehealing.md
@@ -138,9 +146,11 @@ generatedFiles:
- docs/components/internalserverresponseerrordata.md
- docs/components/jsonschemaconfig.md
- docs/components/listendpointsresponse.md
- docs/components/logprob.md
- docs/components/message.md
- docs/components/messagecontent.md
- docs/components/messagedeveloper.md
- docs/components/modality.md
- docs/components/model.md
- docs/components/modelarchitecture.md
- docs/components/modelarchitectureinstructtype.md
@@ -195,14 +205,17 @@ generatedFiles:
- docs/components/openairesponsestoolchoiceunion.md
- docs/components/openairesponsestruncation.md
- docs/components/openresponseseasyinputmessage.md
- docs/components/openresponseseasyinputmessagecontent1.md
- docs/components/openresponseseasyinputmessagecontent2.md
- docs/components/openresponseseasyinputmessagecontentinputimage.md
- docs/components/openresponseseasyinputmessagecontenttype.md
- docs/components/openresponseseasyinputmessagecontentunion1.md
- docs/components/openresponseseasyinputmessagecontentunion2.md
- docs/components/openresponseseasyinputmessagedetail.md
- docs/components/openresponseseasyinputmessageroleassistant.md
- docs/components/openresponseseasyinputmessageroledeveloper.md
- docs/components/openresponseseasyinputmessagerolesystem.md
- docs/components/openresponseseasyinputmessageroleunion.md
- docs/components/openresponseseasyinputmessageroleuser.md
- docs/components/openresponseseasyinputmessagetype.md
- docs/components/openresponseseasyinputmessagetypemessage.md
- docs/components/openresponseserrorevent.md
- docs/components/openresponseserroreventtype.md
- docs/components/openresponsesfunctioncalloutput.md
@@ -220,12 +233,15 @@ generatedFiles:
- docs/components/openresponsesinput.md
- docs/components/openresponsesinput1.md
- docs/components/openresponsesinputmessageitem.md
- docs/components/openresponsesinputmessageitemcontent.md
- docs/components/openresponsesinputmessageitemcontentinputimage.md
- docs/components/openresponsesinputmessageitemcontenttype.md
- docs/components/openresponsesinputmessageitemcontentunion.md
- docs/components/openresponsesinputmessageitemdetail.md
- docs/components/openresponsesinputmessageitemroledeveloper.md
- docs/components/openresponsesinputmessageitemrolesystem.md
- docs/components/openresponsesinputmessageitemroleunion.md
- docs/components/openresponsesinputmessageitemroleuser.md
- docs/components/openresponsesinputmessageitemtype.md
- docs/components/openresponsesinputmessageitemtypemessage.md
- docs/components/openresponseslogprobs.md
- docs/components/openresponsesnonstreamingresponse.md
- docs/components/openresponsesnonstreamingresponsetoolfunction.md
@@ -251,9 +267,11 @@ generatedFiles:
- docs/components/openresponsesreasoningtype.md
- docs/components/openresponsesrequest.md
- docs/components/openresponsesrequestignore.md
- docs/components/openresponsesrequestimageconfig.md
- docs/components/openresponsesrequestmaxprice.md
- docs/components/openresponsesrequestonly.md
- docs/components/openresponsesrequestorder.md
- docs/components/openresponsesrequestpluginautorouter.md
- docs/components/openresponsesrequestpluginfileparser.md
- docs/components/openresponsesrequestpluginmoderation.md
- docs/components/openresponsesrequestpluginresponsehealing.md
@@ -318,7 +336,12 @@ generatedFiles:
- docs/components/pdfengine.md
- docs/components/pdfparserengine.md
- docs/components/pdfparseroptions.md
- docs/components/percentilelatencycutoffs.md
- docs/components/percentilestats.md
- docs/components/percentilethroughputcutoffs.md
- docs/components/perrequestlimits.md
- docs/components/preferredmaxlatency.md
- docs/components/preferredminthroughput.md
- docs/components/pricing.md
- docs/components/prompt.md
- docs/components/prompttokensdetails.md
@@ -365,7 +388,10 @@ generatedFiles:
- docs/components/responseinputimagetype.md
- docs/components/responseinputtext.md
- docs/components/responseinputtexttype.md
- docs/components/responseinputvideo.md
- docs/components/responseinputvideotype.md
- docs/components/responseoutputtext.md
- docs/components/responseoutputtexttoplogprob.md
- docs/components/responseoutputtexttype.md
- docs/components/responseserrorfield.md
- docs/components/responsesformatjsonobject.md
@@ -386,6 +412,7 @@ generatedFiles:
- docs/components/responsesoutputitemfunctioncallstatusunion.md
- docs/components/responsesoutputitemfunctioncalltype.md
- docs/components/responsesoutputitemreasoning.md
- docs/components/responsesoutputitemreasoningformat.md
- docs/components/responsesoutputitemreasoningstatuscompleted.md
- docs/components/responsesoutputitemreasoningstatusincomplete.md
- docs/components/responsesoutputitemreasoningstatusinprogress.md
@@ -399,6 +426,7 @@ generatedFiles:
- docs/components/responsesoutputmessagestatusinprogress.md
- docs/components/responsesoutputmessagestatusunion.md
- docs/components/responsesoutputmessagetype.md
- docs/components/responsesoutputmodality.md
- docs/components/responsessearchcontextsize.md
- docs/components/responseswebsearchcalloutput.md
- docs/components/responseswebsearchcalloutputtype.md
@@ -428,7 +456,6 @@ generatedFiles:
- docs/components/toolresponsemessage.md
- docs/components/toolresponsemessagecontent.md
- docs/components/toomanyrequestsresponseerrordata.md
- docs/components/toplogprob.md
- docs/components/topproviderinfo.md
- docs/components/truncation.md
- docs/components/ttl.md
@@ -684,7 +711,12 @@ generatedFiles:
- src/openrouter/components/paymentrequiredresponseerrordata.py
- src/openrouter/components/pdfparserengine.py
- src/openrouter/components/pdfparseroptions.py
- src/openrouter/components/percentilelatencycutoffs.py
- src/openrouter/components/percentilestats.py
- src/openrouter/components/percentilethroughputcutoffs.py
- src/openrouter/components/perrequestlimits.py
- src/openrouter/components/preferredmaxlatency.py
- src/openrouter/components/preferredminthroughput.py
- src/openrouter/components/providername.py
- src/openrouter/components/provideroverloadedresponseerrordata.py
- src/openrouter/components/providerpreferences.py
@@ -705,6 +737,7 @@ generatedFiles:
- src/openrouter/components/responseinputfile.py
- src/openrouter/components/responseinputimage.py
- src/openrouter/components/responseinputtext.py
- src/openrouter/components/responseinputvideo.py
- src/openrouter/components/responseoutputtext.py
- src/openrouter/components/responseserrorfield.py
- src/openrouter/components/responsesformatjsonobject.py
@@ -716,6 +749,7 @@ generatedFiles:
- src/openrouter/components/responsesoutputitemfunctioncall.py
- src/openrouter/components/responsesoutputitemreasoning.py
- src/openrouter/components/responsesoutputmessage.py
- src/openrouter/components/responsesoutputmodality.py
- src/openrouter/components/responsessearchcontextsize.py
- src/openrouter/components/responseswebsearchcalloutput.py
- src/openrouter/components/responseswebsearchuserlocation.py
@@ -819,7 +853,7 @@ examples:
application/json: {"store": false, "service_tier": "auto", "stream": false}
responses:
"200":
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "completed_at": 2510.63, "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "presence_penalty": 7468.94, "frequency_penalty": 3967.09, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
"400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401":
@@ -932,7 +966,7 @@ examples:
id: "<id>"
responses:
"200":
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions"}}
application/json: {"data": {"id": "gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG", "upstream_id": "chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946", "total_cost": 0.0015, "cache_discount": 0.0002, "upstream_inference_cost": 0.0012, "created_at": "2024-07-15T23:33:19.433273+00:00", "model": "sao10k/l3-stheno-8b", "app_id": 12345, "streamed": true, "cancelled": false, "provider_name": "Infermatic", "latency": 1250, "moderation_latency": 50, "generation_time": 1200, "finish_reason": "stop", "tokens_prompt": 10, "tokens_completion": 25, "native_tokens_prompt": 10, "native_tokens_completion": 25, "native_tokens_completion_images": 0, "native_tokens_reasoning": 5, "native_tokens_cached": 3, "num_media_prompt": 1, "num_input_audio_prompt": 0, "num_media_completion": 0, "num_search_results": 5, "origin": "https://openrouter.ai/", "usage": 0.0015, "is_byok": false, "native_finish_reason": "stop", "external_user": "user-123", "api_type": "completions", "router": "openrouter/auto"}}
"401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"402":
@@ -982,7 +1016,7 @@ examples:
slug: "<value>"
responses:
"200":
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}}
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}}]}}
"404":
application/json: {"error": {"code": 404, "message": "Resource not found"}}
"500":
@@ -991,7 +1025,7 @@ examples:
speakeasy-default-list-endpoints-zdr:
responses:
"200":
application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}
application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}, "throughput_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}}]}
"500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
getParameters:
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
python:
version: 0.0.17
version: 0.0.18
additionalDependencies:
dev: {}
main: {}
+396 -91
View File
@@ -108,6 +108,41 @@ components:
type: array
items:
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
logprobs:
type: array
items:
type: object
properties:
token:
type: string
bytes:
type: array
items:
type: number
logprob:
type: number
top_logprobs:
type: array
items:
type: object
properties:
token:
type: string
bytes:
type: array
items:
type: number
logprob:
type: number
required:
- token
- bytes
- logprob
required:
- token
- bytes
- logprob
- top_logprobs
required:
- type
- text
@@ -268,7 +303,24 @@ components:
allOf:
- $ref: '#/components/schemas/OutputItemReasoning'
- type: object
properties: {}
properties:
signature:
type: string
nullable: true
description: A signature for the reasoning content, used for verification
example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format:
type: string
nullable: true
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
description: The format of the reasoning content
example: anthropic-claude-v1
example:
id: reasoning-123
type: reasoning
@@ -279,6 +331,8 @@ components:
content:
- type: reasoning_text
text: First, we analyze the problem...
signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format: anthropic-claude-v1
description: An output item containing reasoning
OutputItemFunctionCall:
type: object
@@ -538,6 +592,7 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesUsage'
- type: object
nullable: true
properties:
cost:
type: number
@@ -1189,6 +1244,9 @@ components:
type: string
status:
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
completed_at:
type: number
nullable: true
output:
type: array
items:
@@ -1239,6 +1297,12 @@ components:
top_p:
type: number
nullable: true
presence_penalty:
type: number
nullable: true
frequency_penalty:
type: number
nullable: true
instructions:
$ref: '#/components/schemas/OpenAIResponsesInput'
metadata:
@@ -1300,11 +1364,15 @@ components:
- object
- created_at
- model
- status
- completed_at
- output
- error
- incomplete_details
- temperature
- top_p
- presence_penalty
- frequency_penalty
- instructions
- metadata
- tools
@@ -3224,6 +3292,7 @@ components:
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
@@ -3234,6 +3303,23 @@ components:
- type: summary_text
text: Step by step analysis
description: Reasoning output item with signature and format extensions
ResponseInputVideo:
type: object
properties:
type:
type: string
enum:
- input_video
video_url:
type: string
description: A base64 data URL or remote URL that resolves to a video file
required:
- type
- video_url
description: Video input content item
example:
type: input_video
video_url: https://example.com/video.mp4
OpenResponsesEasyInputMessage:
type: object
properties:
@@ -3261,16 +3347,18 @@ components:
items:
oneOf:
- $ref: '#/components/schemas/ResponseInputText'
- $ref: '#/components/schemas/ResponseInputImage'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage'
- type: object
properties: {}
description: Image input content item
example:
type: input_image
detail: auto
image_url: https://example.com/image.jpg
- $ref: '#/components/schemas/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio'
discriminator:
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- $ref: '#/components/schemas/ResponseInputVideo'
- type: string
required:
- role
@@ -3300,16 +3388,18 @@ components:
items:
oneOf:
- $ref: '#/components/schemas/ResponseInputText'
- $ref: '#/components/schemas/ResponseInputImage'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage'
- type: object
properties: {}
description: Image input content item
example:
type: input_image
detail: auto
image_url: https://example.com/image.jpg
- $ref: '#/components/schemas/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio'
discriminator:
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- $ref: '#/components/schemas/ResponseInputVideo'
required:
- role
- content
@@ -3418,6 +3508,11 @@ components:
example:
summary: auto
enabled: true
ResponsesOutputModality:
type: string
enum:
- text
- image
OpenAIResponsesIncludable:
type: string
enum:
@@ -3470,12 +3565,12 @@ components:
- Fireworks
- Friendli
- GMICloud
- GoPomelo
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
@@ -3500,13 +3595,14 @@ components:
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Targon
- Together
- Upstage
- Venice
- WandB
- Xiaomi
@@ -3551,6 +3647,74 @@ components:
type: string
description: A value in string format that is a large number
example: 1000
PercentileThroughputCutoffs:
type: object
properties:
p50:
type: number
nullable: true
description: Minimum p50 throughput (tokens/sec)
p75:
type: number
nullable: true
description: Minimum p75 throughput (tokens/sec)
p90:
type: number
nullable: true
description: Minimum p90 throughput (tokens/sec)
p99:
type: number
nullable: true
description: Minimum p99 throughput (tokens/sec)
description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
example:
p50: 100
p90: 50
PreferredMinThroughput:
anyOf:
- type: number
- $ref: '#/components/schemas/PercentileThroughputCutoffs'
- nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with
percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in
routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if
it meets the threshold.
example: 100
PercentileLatencyCutoffs:
type: object
properties:
p50:
type: number
nullable: true
description: Maximum p50 latency (seconds)
p75:
type: number
nullable: true
description: Maximum p75 latency (seconds)
p90:
type: number
nullable: true
description: Maximum p90 latency (seconds)
p99:
type: number
nullable: true
description: Maximum p99 latency (seconds)
description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
example:
p50: 5
p90: 10
PreferredMaxLatency:
anyOf:
- type: number
- $ref: '#/components/schemas/PercentileLatencyCutoffs'
- nullable: true
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific
cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using
fallback models, this may cause a fallback model to be used instead of the primary model if it meets the
threshold.
example: 5
WebSearchEngine:
type: string
enum:
@@ -3637,8 +3801,45 @@ components:
type: number
nullable: true
minimum: 0
top_logprobs:
type: integer
nullable: true
minimum: 0
maximum: 20
max_tool_calls:
type: integer
nullable: true
presence_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
frequency_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
top_k:
type: number
image_config:
type: object
additionalProperties:
anyOf:
- type: string
- type: number
description: >-
Provider-specific image configuration options. Keys and values vary by model/provider. See
https://openrouter.ai/docs/features/multimodal/image-generation for more details.
example:
aspect_ratio: '16:9'
modalities:
type: array
items:
$ref: '#/components/schemas/ResponsesOutputModality'
description: Output modalities for the response. Supported values are "text" and "image".
example:
- text
- image
prompt_cache_key:
type: string
nullable: true
@@ -3774,43 +3975,38 @@ components:
The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion.
preferred_min_throughput:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used,
but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used
instead of the primary model if it meets the threshold.
example: 100
$ref: '#/components/schemas/PreferredMinThroughput'
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead
of the primary model if it meets the threshold.
example: 5
min_throughput:
type: number
nullable: true
deprecated: true
description: >-
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for
preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
$ref: '#/components/schemas/PreferredMaxLatency'
additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference.
plugins:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
enum:
- auto-router
enabled:
type: boolean
description: Set to false to disable the auto-router plugin for this request. Defaults to true.
allowed_models:
type: array
items:
type: string
description: >-
List of model patterns to filter which models the auto-router can route between. Supports
wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default
supported models list.
example:
- anthropic/*
- openai/gpt-4o
- google/*
required:
- id
- type: object
properties:
id:
@@ -4132,37 +4328,9 @@ components:
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
prompt and completion.
preferred_min_throughput:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but
are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead
of the primary model if it meets the threshold.
example: 100
$ref: '#/components/schemas/PreferredMinThroughput'
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of
the primary model if it meets the threshold.
example: 5
min_throughput:
type: number
nullable: true
deprecated: true
description: >-
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for
preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
$ref: '#/components/schemas/PreferredMaxLatency'
description: Provider routing preferences for the request.
PublicPricing:
type: object
@@ -4595,6 +4763,34 @@ components:
- -5
- -10
example: 0
PercentileStats:
type: object
nullable: true
properties:
p50:
type: number
description: Median (50th percentile)
example: 25.5
p75:
type: number
description: 75th percentile
example: 35.2
p90:
type: number
description: 90th percentile
example: 48.7
p99:
type: number
description: 99th percentile
example: 85.3
required:
- p50
- p75
- p90
- p99
description: >-
Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible
when authenticated with an API key or cookie; returns null for unauthenticated requests.
PublicEndpoint:
type: object
properties:
@@ -4662,6 +4858,15 @@ components:
nullable: true
supports_implicit_caching:
type: boolean
latency_last_30m:
$ref: '#/components/schemas/PercentileStats'
throughput_last_30m:
allOf:
- $ref: '#/components/schemas/PercentileStats'
- description: >-
Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token
generation speed. Only visible when authenticated with an API key or cookie; returns null for
unauthenticated requests.
required:
- name
- model_name
@@ -4675,6 +4880,8 @@ components:
- supported_parameters
- uptime_last_30m
- supports_implicit_caching
- latency_last_30m
- throughput_last_30m
description: Information about a specific model endpoint
example:
name: 'OpenAI: GPT-4'
@@ -4697,6 +4904,16 @@ components:
status: 0
uptime_last_30m: 99.5
supports_implicit_caching: true
latency_last_30m:
p50: 0.25
p75: 0.35
p90: 0.48
p99: 0.85
throughput_last_30m:
p50: 45.2
p75: 38.5
p90: 28.3
p99: 15.1
ListEndpointsResponse:
type: object
properties:
@@ -4800,6 +5017,16 @@ components:
status: default
uptime_last_30m: 99.5
supports_implicit_caching: true
latency_last_30m:
p50: 0.25
p75: 0.35
p90: 0.48
p99: 0.85
throughput_last_30m:
p50: 45.2
p75: 38.5
p90: 28.3
p99: 15.1
__schema0:
type: array
items:
@@ -4832,12 +5059,12 @@ components:
- Fireworks
- Friendli
- GMICloud
- GoPomelo
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
@@ -4862,13 +5089,14 @@ components:
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Targon
- Together
- Upstage
- Venice
- WandB
- Xiaomi
@@ -4951,6 +5179,7 @@ components:
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
@@ -5174,6 +5403,8 @@ components:
properties:
cached_tokens:
type: number
cache_write_tokens:
type: number
audio_tokens:
type: number
video_tokens:
@@ -5521,20 +5752,60 @@ components:
request:
$ref: '#/components/schemas/__schema1'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object
with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used
instead of the primary model if it meets the threshold.
anyOf:
- type: number
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with
percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are
deprioritized in routing. When using fallback models, this may cause a fallback model to be used
instead of the primary model if it meets the threshold.
anyOf:
- type: number
- type: 'null'
min_throughput:
anyOf:
- type: number
- type: 'null'
max_latency:
anyOf:
- type: number
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false
- type: 'null'
@@ -5543,6 +5814,19 @@ components:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
@@ -5760,6 +6044,21 @@ components:
properties:
echo_upstream_body:
type: boolean
image_config:
type: object
propertyNames:
type: string
additionalProperties:
anyOf:
- type: string
- type: number
modalities:
type: array
items:
type: string
enum:
- text
- image
required:
- messages
ProviderSortUnion:
@@ -6987,6 +7286,11 @@ paths:
- completions
- embeddings
description: Type of API used for the generation
router:
type: string
nullable: true
description: Router used for the request (e.g., openrouter/auto)
example: openrouter/auto
required:
- id
- upstream_id
@@ -7020,6 +7324,7 @@ paths:
- native_finish_reason
- external_user
- api_type
- router
description: Generation data
required:
- data
+381 -81
View File
@@ -109,6 +109,41 @@ components:
type: array
items:
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
logprobs:
type: array
items:
type: object
properties:
token:
type: string
bytes:
type: array
items:
type: number
logprob:
type: number
top_logprobs:
type: array
items:
type: object
properties:
token:
type: string
bytes:
type: array
items:
type: number
logprob:
type: number
required:
- token
- bytes
- logprob
required:
- token
- bytes
- logprob
- top_logprobs
required:
- type
- text
@@ -269,7 +304,25 @@ components:
allOf:
- $ref: '#/components/schemas/OutputItemReasoning'
- type: object
properties: {}
properties:
signature:
type: string
nullable: true
description: A signature for the reasoning content, used for verification
example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format:
type: string
nullable: true
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
description: The format of the reasoning content
example: anthropic-claude-v1
x-speakeasy-unknown-values: allow
example:
id: reasoning-123
type: reasoning
@@ -280,6 +333,8 @@ components:
content:
- type: reasoning_text
text: First, we analyze the problem...
signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format: anthropic-claude-v1
description: An output item containing reasoning
OutputItemFunctionCall:
type: object
@@ -543,6 +598,7 @@ components:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesUsage'
- type: object
nullable: true
properties:
cost:
type: number
@@ -1203,6 +1259,9 @@ components:
type: string
status:
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
completed_at:
type: number
nullable: true
output:
type: array
items:
@@ -1253,6 +1312,12 @@ components:
top_p:
type: number
nullable: true
presence_penalty:
type: number
nullable: true
frequency_penalty:
type: number
nullable: true
instructions:
$ref: '#/components/schemas/OpenAIResponsesInput'
metadata:
@@ -1315,11 +1380,15 @@ components:
- object
- created_at
- model
- status
- completed_at
- output
- error
- incomplete_details
- temperature
- top_p
- presence_penalty
- frequency_penalty
- instructions
- metadata
- tools
@@ -3239,6 +3308,7 @@ components:
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
@@ -3250,6 +3320,23 @@ components:
- type: summary_text
text: Step by step analysis
description: Reasoning output item with signature and format extensions
ResponseInputVideo:
type: object
properties:
type:
type: string
enum:
- input_video
video_url:
type: string
description: A base64 data URL or remote URL that resolves to a video file
required:
- type
- video_url
description: Video input content item
example:
type: input_video
video_url: https://example.com/video.mp4
OpenResponsesEasyInputMessage:
type: object
properties:
@@ -3277,16 +3364,18 @@ components:
items:
oneOf:
- $ref: '#/components/schemas/ResponseInputText'
- $ref: '#/components/schemas/ResponseInputImage'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage'
- type: object
properties: {}
description: Image input content item
example:
type: input_image
detail: auto
image_url: https://example.com/image.jpg
- $ref: '#/components/schemas/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio'
discriminator:
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- $ref: '#/components/schemas/ResponseInputVideo'
- type: string
required:
- role
@@ -3316,16 +3405,18 @@ components:
items:
oneOf:
- $ref: '#/components/schemas/ResponseInputText'
- $ref: '#/components/schemas/ResponseInputImage'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage'
- type: object
properties: {}
description: Image input content item
example:
type: input_image
detail: auto
image_url: https://example.com/image.jpg
- $ref: '#/components/schemas/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio'
discriminator:
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- $ref: '#/components/schemas/ResponseInputVideo'
required:
- role
- content
@@ -3434,6 +3525,12 @@ components:
example:
summary: auto
enabled: true
ResponsesOutputModality:
type: string
enum:
- text
- image
x-speakeasy-unknown-values: allow
OpenAIResponsesIncludable:
type: string
enum:
@@ -3487,12 +3584,12 @@ components:
- Fireworks
- Friendli
- GMICloud
- GoPomelo
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
@@ -3517,13 +3614,14 @@ components:
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Targon
- Together
- Upstage
- Venice
- WandB
- Xiaomi
@@ -3572,6 +3670,68 @@ components:
type: string
description: A value in string format that is a large number
example: 1000
PercentileThroughputCutoffs:
type: object
properties:
p50:
type: number
nullable: true
description: Minimum p50 throughput (tokens/sec)
p75:
type: number
nullable: true
description: Minimum p75 throughput (tokens/sec)
p90:
type: number
nullable: true
description: Minimum p90 throughput (tokens/sec)
p99:
type: number
nullable: true
description: Minimum p99 throughput (tokens/sec)
description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
example:
p50: 100
p90: 50
PreferredMinThroughput:
anyOf:
- type: number
- $ref: '#/components/schemas/PercentileThroughputCutoffs'
- nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 100
PercentileLatencyCutoffs:
type: object
properties:
p50:
type: number
nullable: true
description: Maximum p50 latency (seconds)
p75:
type: number
nullable: true
description: Maximum p75 latency (seconds)
p90:
type: number
nullable: true
description: Maximum p90 latency (seconds)
p99:
type: number
nullable: true
description: Maximum p99 latency (seconds)
description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
example:
p50: 5
p90: 10
PreferredMaxLatency:
anyOf:
- type: number
- $ref: '#/components/schemas/PercentileLatencyCutoffs'
- nullable: true
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 5
WebSearchEngine:
type: string
enum:
@@ -3661,8 +3821,44 @@ components:
type: number
nullable: true
minimum: 0
top_logprobs:
type: integer
nullable: true
minimum: 0
maximum: 20
max_tool_calls:
type: integer
nullable: true
presence_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
frequency_penalty:
type: number
nullable: true
minimum: -2
maximum: 2
top_k:
type: number
image_config:
type: object
additionalProperties:
anyOf:
- type: string
- type: number
description: >-
Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
example:
aspect_ratio: '16:9'
modalities:
type: array
items:
$ref: '#/components/schemas/ResponsesOutputModality'
description: Output modalities for the response. Supported values are "text" and "image".
example:
- text
- image
prompt_cache_key:
type: string
nullable: true
@@ -3788,38 +3984,36 @@ components:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
preferred_min_throughput:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 100
$ref: '#/components/schemas/PreferredMinThroughput'
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 5
min_throughput:
type: number
nullable: true
deprecated: true
description: >-
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
$ref: '#/components/schemas/PreferredMaxLatency'
additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference.
plugins:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
enum:
- auto-router
enabled:
type: boolean
description: Set to false to disable the auto-router plugin for this request. Defaults to true.
allowed_models:
type: array
items:
type: string
description: >-
List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list.
example:
- anthropic/*
- openai/gpt-4o
- google/*
required:
- id
- type: object
properties:
id:
@@ -4129,32 +4323,9 @@ components:
description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
preferred_min_throughput:
type: number
nullable: true
description: >-
Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 100
$ref: '#/components/schemas/PreferredMinThroughput'
preferred_max_latency:
type: number
nullable: true
description: >-
Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
example: 5
min_throughput:
type: number
nullable: true
deprecated: true
description: >-
**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput.
example: 100
x-speakeasy-deprecation-message: Use preferred_min_throughput instead.
max_latency:
type: number
nullable: true
deprecated: true
description: '**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency.'
example: 5
x-speakeasy-deprecation-message: Use preferred_max_latency instead.
$ref: '#/components/schemas/PreferredMaxLatency'
description: Provider routing preferences for the request.
PublicPricing:
type: object
@@ -4594,6 +4765,33 @@ components:
- -10
example: 0
x-speakeasy-unknown-values: allow
PercentileStats:
type: object
nullable: true
properties:
p50:
type: number
description: Median (50th percentile)
example: 25.5
p75:
type: number
description: 75th percentile
example: 35.2
p90:
type: number
description: 90th percentile
example: 48.7
p99:
type: number
description: 99th percentile
example: 85.3
required:
- p50
- p75
- p90
- p99
description: >-
Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.
PublicEndpoint:
type: object
properties:
@@ -4661,6 +4859,13 @@ components:
nullable: true
supports_implicit_caching:
type: boolean
latency_last_30m:
$ref: '#/components/schemas/PercentileStats'
throughput_last_30m:
allOf:
- $ref: '#/components/schemas/PercentileStats'
- description: >-
Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.
required:
- name
- model_name
@@ -4674,6 +4879,8 @@ components:
- supported_parameters
- uptime_last_30m
- supports_implicit_caching
- latency_last_30m
- throughput_last_30m
description: Information about a specific model endpoint
example:
name: 'OpenAI: GPT-4'
@@ -4696,6 +4903,16 @@ components:
status: 0
uptime_last_30m: 99.5
supports_implicit_caching: true
latency_last_30m:
p50: 0.25
p75: 0.35
p90: 0.48
p99: 0.85
throughput_last_30m:
p50: 45.2
p75: 38.5
p90: 28.3
p99: 15.1
ListEndpointsResponse:
type: object
properties:
@@ -4799,6 +5016,16 @@ components:
status: default
uptime_last_30m: 99.5
supports_implicit_caching: true
latency_last_30m:
p50: 0.25
p75: 0.35
p90: 0.48
p99: 0.85
throughput_last_30m:
p50: 45.2
p75: 38.5
p90: 28.3
p99: 15.1
__schema0:
type: array
items:
@@ -4831,12 +5058,12 @@ components:
- Fireworks
- Friendli
- GMICloud
- GoPomelo
- Google
- Google AI Studio
- Groq
- Hyperbolic
- Inception
- Inceptron
- InferenceNet
- Infermatic
- Inflection
@@ -4861,13 +5088,14 @@ components:
- Phala
- Relace
- SambaNova
- Seed
- SiliconFlow
- Sourceful
- Stealth
- StreamLake
- Switchpoint
- Targon
- Together
- Upstage
- Venice
- WandB
- Xiaomi
@@ -4951,6 +5179,7 @@ components:
enum:
- unknown
- openai-responses-v1
- azure-openai-responses-v1
- xai-responses-v1
- anthropic-claude-v1
- google-gemini-v1
@@ -5176,6 +5405,8 @@ components:
properties:
cached_tokens:
type: number
cache_write_tokens:
type: number
audio_tokens:
type: number
video_tokens:
@@ -5518,20 +5749,54 @@ components:
request:
$ref: '#/components/schemas/__schema1'
preferred_min_throughput:
description: >-
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
anyOf:
- type: number
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
preferred_max_latency:
description: >-
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
anyOf:
- type: number
- type: 'null'
min_throughput:
anyOf:
- type: number
- type: 'null'
max_latency:
anyOf:
- type: number
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf:
- type: number
- type: 'null'
p75:
anyOf:
- type: number
- type: 'null'
p90:
anyOf:
- type: number
- type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false
- type: 'null'
@@ -5540,6 +5805,19 @@ components:
type: array
items:
oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object
properties:
id:
@@ -5759,6 +6037,22 @@ components:
properties:
echo_upstream_body:
type: boolean
image_config:
type: object
propertyNames:
type: string
additionalProperties:
anyOf:
- type: string
- type: number
modalities:
type: array
items:
type: string
enum:
- text
- image
x-speakeasy-unknown-values: allow
required:
- messages
ProviderSortUnion:
@@ -6989,6 +7283,11 @@ paths:
- embeddings
description: Type of API used for the generation
x-speakeasy-unknown-values: allow
router:
type: string
nullable: true
description: Router used for the request (e.g., openrouter/auto)
example: openrouter/auto
required:
- id
- upstream_id
@@ -7022,6 +7321,7 @@ paths:
- native_finish_reason
- external_user
- api_type
- router
description: Generation data
required:
- data
+5 -5
View File
@@ -8,8 +8,8 @@ sources:
- latest
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:92f6f1568ba089ae8e52bd55d859a97e446ae232c4c9ca9302ea64705313c7a0
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
tags:
- latest
- 1.0.0
@@ -17,10 +17,10 @@ targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:92f6f1568ba089ae8e52bd55d859a97e446ae232c4c9ca9302ea64705313c7a0
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc
sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:8340c172a77ca9ffeeea6ca5dce0d69a084a3ba0a4e2e41d098759f546d80da4
codeSamplesRevisionDigest: sha256:95a78f7dc072063abfd68a880ad1054c27a9a9077449cbf667d07de13a15112a
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.666.0
+3 -1
View File
@@ -31,4 +31,6 @@
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | N/A |
@@ -0,0 +1,17 @@
# ChatGenerationParamsImageConfig
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `float`
```python
value: float = /* values here */
```
@@ -0,0 +1,10 @@
# ChatGenerationParamsPluginAutoRouter
## Fields
| Field | Type | Required | Description |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `id` | *Literal["auto-router"]* | :heavy_check_mark: | N/A |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `allowed_models` | List[*str*] | :heavy_minus_sign: | N/A |
@@ -3,6 +3,12 @@
## Supported Types
### `components.ChatGenerationParamsPluginAutoRouter`
```python
value: components.ChatGenerationParamsPluginAutoRouter = /* values here */
```
### `components.ChatGenerationParamsPluginModeration`
```python
@@ -0,0 +1,11 @@
# ChatGenerationParamsPreferredMaxLatency
## Fields
| Field | Type | Required | Description |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,17 @@
# ChatGenerationParamsPreferredMaxLatencyUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMaxLatency`
```python
value: components.ChatGenerationParamsPreferredMaxLatency = /* values here */
```
@@ -0,0 +1,11 @@
# ChatGenerationParamsPreferredMinThroughput
## Fields
| Field | Type | Required | Description |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,17 @@
# ChatGenerationParamsPreferredMinThroughputUnion
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.ChatGenerationParamsPreferredMinThroughput`
```python
value: components.ChatGenerationParamsPreferredMinThroughput = /* values here */
```
+15 -17
View File
@@ -3,20 +3,18 @@
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. |
| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. |
| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. |
| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. |
| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. |
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. |
| `preferred_min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `preferred_max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. |
| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. |
| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. |
| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. |
| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. |
| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. |
| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. |
| `preferred_min_throughput` | [OptionalNullable[components.ChatGenerationParamsPreferredMinThroughputUnion]](../components/chatgenerationparamspreferredminthroughputunion.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
| `preferred_max_latency` | [OptionalNullable[components.ChatGenerationParamsPreferredMaxLatencyUnion]](../components/chatgenerationparamspreferredmaxlatencyunion.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. |
+6 -6
View File
@@ -3,9 +3,9 @@
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `top_logprobs` | List[[components.TopLogprob](../components/toplogprob.md)] | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `top_logprobs` | List[[components.ChatMessageTokenLogprobTopLogprob](../components/chatmessagetokenlogprobtoplogprob.md)] | :heavy_check_mark: | N/A |
@@ -0,0 +1,10 @@
# ChatMessageTokenLogprobTopLogprob
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
+8
View File
@@ -0,0 +1,8 @@
# IDAutoRouter
## Values
| Name | Value |
| ------------- | ------------- |
| `AUTO_ROUTER` | auto-router |
+11
View File
@@ -0,0 +1,11 @@
# Logprob
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `token` | *str* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `top_logprobs` | List[[components.ResponseOutputTextTopLogprob](../components/responseoutputtexttoplogprob.md)] | :heavy_check_mark: | N/A |
+9
View File
@@ -0,0 +1,9 @@
# Modality
## Values
| Name | Value |
| ------- | ------- |
| `TEXT` | text |
| `IMAGE` | image |
@@ -3,8 +3,8 @@
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `type` | [Optional[components.OpenResponsesEasyInputMessageType]](../components/openresponseseasyinputmessagetype.md) | :heavy_minus_sign: | N/A |
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
| `content` | [components.OpenResponsesEasyInputMessageContent2](../components/openresponseseasyinputmessagecontent2.md) | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A |
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
| `content` | [components.OpenResponsesEasyInputMessageContentUnion2](../components/openresponseseasyinputmessagecontentunion2.md) | :heavy_check_mark: | N/A |
@@ -1,17 +0,0 @@
# OpenResponsesEasyInputMessageContent2
## Supported Types
### `List[components.OpenResponsesEasyInputMessageContent1]`
```python
value: List[components.OpenResponsesEasyInputMessageContent1] = /* values here */
```
### `str`
```python
value: str = /* values here */
```
@@ -0,0 +1,12 @@
# OpenResponsesEasyInputMessageContentInputImage
Image input content item
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesEasyInputMessageContentType](../components/openresponseseasyinputmessagecontenttype.md) | :heavy_check_mark: | N/A |
| `detail` | [components.OpenResponsesEasyInputMessageDetail](../components/openresponseseasyinputmessagedetail.md) | :heavy_check_mark: | N/A |
| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,8 @@
# OpenResponsesEasyInputMessageContentType
## Values
| Name | Value |
| ------------- | ------------- |
| `INPUT_IMAGE` | input_image |
@@ -1,4 +1,4 @@
# OpenResponsesInputMessageItemContent
# OpenResponsesEasyInputMessageContentUnion1
## Supported Types
@@ -9,10 +9,10 @@
value: components.ResponseInputText = /* values here */
```
### `components.ResponseInputImage`
### `components.OpenResponsesEasyInputMessageContentInputImage`
```python
value: components.ResponseInputImage = /* values here */
value: components.OpenResponsesEasyInputMessageContentInputImage = /* values here */
```
### `components.ResponseInputFile`
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
value: components.ResponseInputAudio = /* values here */
```
### `components.ResponseInputVideo`
```python
value: components.ResponseInputVideo = /* values here */
```
@@ -0,0 +1,17 @@
# OpenResponsesEasyInputMessageContentUnion2
## Supported Types
### `List[components.OpenResponsesEasyInputMessageContentUnion1]`
```python
value: List[components.OpenResponsesEasyInputMessageContentUnion1] = /* values here */
```
### `str`
```python
value: str = /* values here */
```
@@ -0,0 +1,10 @@
# OpenResponsesEasyInputMessageDetail
## Values
| Name | Value |
| ------ | ------ |
| `AUTO` | auto |
| `HIGH` | high |
| `LOW` | low |
@@ -1,4 +1,4 @@
# OpenResponsesInputMessageItemType
# OpenResponsesEasyInputMessageTypeMessage
## Values
@@ -3,9 +3,9 @@
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `type` | [Optional[components.OpenResponsesInputMessageItemType]](../components/openresponsesinputmessageitemtype.md) | :heavy_minus_sign: | N/A |
| `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A |
| `content` | List[[components.OpenResponsesInputMessageItemContent](../components/openresponsesinputmessageitemcontent.md)] | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `type` | [Optional[components.OpenResponsesInputMessageItemTypeMessage]](../components/openresponsesinputmessageitemtypemessage.md) | :heavy_minus_sign: | N/A |
| `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A |
| `content` | List[[components.OpenResponsesInputMessageItemContentUnion](../components/openresponsesinputmessageitemcontentunion.md)] | :heavy_check_mark: | N/A |
@@ -0,0 +1,12 @@
# OpenResponsesInputMessageItemContentInputImage
Image input content item
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesInputMessageItemContentType](../components/openresponsesinputmessageitemcontenttype.md) | :heavy_check_mark: | N/A |
| `detail` | [components.OpenResponsesInputMessageItemDetail](../components/openresponsesinputmessageitemdetail.md) | :heavy_check_mark: | N/A |
| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,8 @@
# OpenResponsesInputMessageItemContentType
## Values
| Name | Value |
| ------------- | ------------- |
| `INPUT_IMAGE` | input_image |
@@ -1,4 +1,4 @@
# OpenResponsesEasyInputMessageContent1
# OpenResponsesInputMessageItemContentUnion
## Supported Types
@@ -9,10 +9,10 @@
value: components.ResponseInputText = /* values here */
```
### `components.ResponseInputImage`
### `components.OpenResponsesInputMessageItemContentInputImage`
```python
value: components.ResponseInputImage = /* values here */
value: components.OpenResponsesInputMessageItemContentInputImage = /* values here */
```
### `components.ResponseInputFile`
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
value: components.ResponseInputAudio = /* values here */
```
### `components.ResponseInputVideo`
```python
value: components.ResponseInputVideo = /* values here */
```
@@ -0,0 +1,10 @@
# OpenResponsesInputMessageItemDetail
## Values
| Name | Value |
| ------ | ------ |
| `AUTO` | auto |
| `HIGH` | high |
| `LOW` | low |
@@ -1,4 +1,4 @@
# OpenResponsesEasyInputMessageType
# OpenResponsesInputMessageItemTypeMessage
## Values
@@ -11,7 +11,8 @@ Complete non-streaming response from the Responses API
| `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | |
| `created_at` | *float* | :heavy_check_mark: | N/A | |
| `model` | *str* | :heavy_check_mark: | N/A | |
| `status` | [Optional[components.OpenAIResponsesResponseStatus]](../components/openairesponsesresponsestatus.md) | :heavy_minus_sign: | N/A | |
| `status` | [components.OpenAIResponsesResponseStatus](../components/openairesponsesresponsestatus.md) | :heavy_check_mark: | N/A | |
| `completed_at` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `output` | List[[components.ResponsesOutputItem](../components/responsesoutputitem.md)] | :heavy_check_mark: | N/A | |
| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `output_text` | *Optional[str]* | :heavy_minus_sign: | N/A | |
@@ -19,12 +20,14 @@ Complete non-streaming response from the Responses API
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `error` | [Nullable[components.ResponsesErrorField]](../components/responseserrorfield.md) | :heavy_check_mark: | Error information returned from the API | {<br/>"code": "rate_limit_exceeded",<br/>"message": "Rate limit exceeded. Please try again later."<br/>} |
| `incomplete_details` | [Nullable[components.OpenAIResponsesIncompleteDetails]](../components/openairesponsesincompletedetails.md) | :heavy_check_mark: | N/A | |
| `usage` | [Optional[components.OpenResponsesUsage]](../components/openresponsesusage.md) | :heavy_minus_sign: | Token usage information for the response | {<br/>"input_tokens": 10,<br/>"output_tokens": 25,<br/>"total_tokens": 35,<br/>"input_tokens_details": {<br/>"cached_tokens": 0<br/>},<br/>"output_tokens_details": {<br/>"reasoning_tokens": 0<br/>},<br/>"cost": 0.0012,<br/>"cost_details": {<br/>"upstream_inference_cost": null,<br/>"upstream_inference_input_cost": 0.0008,<br/>"upstream_inference_output_cost": 0.0004<br/>}<br/>} |
| `usage` | [OptionalNullable[components.OpenResponsesUsage]](../components/openresponsesusage.md) | :heavy_minus_sign: | Token usage information for the response | {<br/>"input_tokens": 10,<br/>"output_tokens": 25,<br/>"total_tokens": 35,<br/>"input_tokens_details": {<br/>"cached_tokens": 0<br/>},<br/>"output_tokens_details": {<br/>"reasoning_tokens": 0<br/>},<br/>"cost": 0.0012,<br/>"cost_details": {<br/>"upstream_inference_cost": null,<br/>"upstream_inference_input_cost": 0.0008,<br/>"upstream_inference_output_cost": 0.0004<br/>}<br/>} |
| `max_tool_calls` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `top_p` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `presence_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `frequency_penalty` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `instructions` | [Nullable[components.OpenAIResponsesInputUnion]](../components/openairesponsesinputunion.md) | :heavy_check_mark: | N/A | |
| `metadata` | Dict[str, *str*] | :heavy_check_mark: | 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. | {<br/>"user_id": "123",<br/>"session_id": "abc-def-ghi"<br/>} |
| `tools` | List[[components.OpenResponsesNonStreamingResponseToolUnion](../components/openresponsesnonstreamingresponsetoolunion.md)] | :heavy_check_mark: | N/A | |
@@ -3,10 +3,11 @@
## Values
| Name | Value |
| --------------------- | --------------------- |
| `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 |
| Name | Value |
| --------------------------- | --------------------------- |
| `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 |
+6
View File
@@ -20,7 +20,13 @@ Request schema for Responses endpoint
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
| `modalities` | List[[components.ResponsesOutputModality](../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,17 @@
# OpenResponsesRequestImageConfig
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `float`
```python
value: float = /* values here */
```
@@ -0,0 +1,10 @@
# OpenResponsesRequestPluginAutoRouter
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | [components.IDAutoRouter](../components/idautorouter.md) | :heavy_check_mark: | N/A | |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | |
| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [<br/>"anthropic/*",<br/>"openai/gpt-4o",<br/>"google/*"<br/>] |
@@ -3,6 +3,12 @@
## Supported Types
### `components.OpenResponsesRequestPluginAutoRouter`
```python
value: components.OpenResponsesRequestPluginAutoRouter = /* values here */
```
### `components.OpenResponsesRequestPluginModeration`
```python
+15 -17
View File
@@ -5,20 +5,18 @@ When multiple model providers are available, optionally indicate your routing pr
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
| `order` | List[[components.OpenResponsesRequestOrder](../components/openresponsesrequestorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
| `only` | List[[components.OpenResponsesRequestOnly](../components/openresponsesrequestonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| `ignore` | List[[components.OpenResponsesRequestIgnore](../components/openresponsesrequestignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
| `sort` | [OptionalNullable[components.OpenResponsesRequestSort]](../components/openresponsesrequestsort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
| `max_price` | [Optional[components.OpenResponsesRequestMaxPrice]](../components/openresponsesrequestmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
| `preferred_min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
| `preferred_max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
| ~~`min_throughput`~~ | *OptionalNullable[float]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: Use preferred_min_throughput instead..<br/><br/>**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput. | 100 |
| ~~`max_latency`~~ | *OptionalNullable[float]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: Use preferred_max_latency instead..<br/><br/>**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency. | 5 |
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
| `order` | List[[components.OpenResponsesRequestOrder](../components/openresponsesrequestorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
| `only` | List[[components.OpenResponsesRequestOnly](../components/openresponsesrequestonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| `ignore` | List[[components.OpenResponsesRequestIgnore](../components/openresponsesrequestignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
| `sort` | [OptionalNullable[components.OpenResponsesRequestSort]](../components/openresponsesrequestsort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
| `max_price` | [Optional[components.OpenResponsesRequestMaxPrice]](../components/openresponsesrequestmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
@@ -0,0 +1,13 @@
# PercentileLatencyCutoffs
Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
## Fields
| Field | Type | Required | Description |
| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p50 latency (seconds) |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p75 latency (seconds) |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p90 latency (seconds) |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p99 latency (seconds) |
+13
View File
@@ -0,0 +1,13 @@
# PercentileStats
Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.
## Fields
| Field | Type | Required | Description | Example |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `p50` | *float* | :heavy_check_mark: | Median (50th percentile) | 25.5 |
| `p75` | *float* | :heavy_check_mark: | 75th percentile | 35.2 |
| `p90` | *float* | :heavy_check_mark: | 90th percentile | 48.7 |
| `p99` | *float* | :heavy_check_mark: | 99th percentile | 85.3 |
@@ -0,0 +1,13 @@
# PercentileThroughputCutoffs
Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
## Fields
| Field | Type | Required | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p50 throughput (tokens/sec) |
| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p75 throughput (tokens/sec) |
| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p90 throughput (tokens/sec) |
| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p99 throughput (tokens/sec) |
+25
View File
@@ -0,0 +1,25 @@
# PreferredMaxLatency
Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.PercentileLatencyCutoffs`
```python
value: components.PercentileLatencyCutoffs = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
+25
View File
@@ -0,0 +1,25 @@
# PreferredMinThroughput
Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
## Supported Types
### `float`
```python
value: float = /* values here */
```
### `components.PercentileThroughputCutoffs`
```python
value: components.PercentileThroughputCutoffs = /* values here */
```
### `Any`
```python
value: Any = /* values here */
```
+6 -5
View File
@@ -3,8 +3,9 @@
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `cached_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `audio_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `video_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description |
| -------------------- | -------------------- | -------------------- | -------------------- |
| `cached_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `cache_write_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `audio_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `video_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
+3 -2
View File
@@ -31,12 +31,12 @@
| `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq |
| `HYPERBOLIC` | Hyperbolic |
| `INCEPTION` | Inception |
| `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic |
| `INFLECTION` | Inflection |
@@ -61,13 +61,14 @@
| `PHALA` | Phala |
| `RELACE` | Relace |
| `SAMBA_NOVA` | SambaNova |
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon |
| `TOGETHER` | Together |
| `UPSTAGE` | Upstage |
| `VENICE` | Venice |
| `WAND_B` | WandB |
| `XIAOMI` | Xiaomi |
+15 -17
View File
@@ -5,20 +5,18 @@ Provider routing preferences for the request.
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
| `order` | List[[components.ProviderPreferencesOrder](../components/providerpreferencesorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
| `only` | List[[components.ProviderPreferencesOnly](../components/providerpreferencesonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| `ignore` | List[[components.ProviderPreferencesIgnore](../components/providerpreferencesignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
| `sort` | [OptionalNullable[components.ProviderPreferencesSortUnion]](../components/providerpreferencessortunion.md) | :heavy_minus_sign: | N/A | |
| `max_price` | [Optional[components.ProviderPreferencesMaxPrice]](../components/providerpreferencesmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
| `preferred_min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
| `preferred_max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
| ~~`min_throughput`~~ | *OptionalNullable[float]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: Use preferred_min_throughput instead..<br/><br/>**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput. | 100 |
| ~~`max_latency`~~ | *OptionalNullable[float]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: Use preferred_max_latency instead..<br/><br/>**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency. | 5 |
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/><br/>- deny: use only providers which do not collect user data. | allow |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
| `order` | List[[components.ProviderPreferencesOrder](../components/providerpreferencesorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
| `only` | List[[components.ProviderPreferencesOnly](../components/providerpreferencesonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| `ignore` | List[[components.ProviderPreferencesIgnore](../components/providerpreferencesignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
| `sort` | [OptionalNullable[components.ProviderPreferencesSortUnion]](../components/providerpreferencessortunion.md) | :heavy_minus_sign: | N/A | |
| `max_price` | [Optional[components.ProviderPreferencesMaxPrice]](../components/providerpreferencesmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
+17 -15
View File
@@ -5,18 +5,20 @@ Information about a specific model endpoint
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `name` | *str* | :heavy_check_mark: | N/A | |
| `model_name` | *str* | :heavy_check_mark: | N/A | |
| `context_length` | *float* | :heavy_check_mark: | N/A | |
| `pricing` | [components.Pricing](../components/pricing.md) | :heavy_check_mark: | N/A | |
| `provider_name` | [components.ProviderName](../components/providername.md) | :heavy_check_mark: | N/A | OpenAI |
| `tag` | *str* | :heavy_check_mark: | N/A | |
| `quantization` | [Nullable[components.PublicEndpointQuantization]](../components/publicendpointquantization.md) | :heavy_check_mark: | N/A | fp16 |
| `max_completion_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `max_prompt_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | N/A | |
| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 |
| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | |
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | *str* | :heavy_check_mark: | N/A | |
| `model_name` | *str* | :heavy_check_mark: | N/A | |
| `context_length` | *float* | :heavy_check_mark: | N/A | |
| `pricing` | [components.Pricing](../components/pricing.md) | :heavy_check_mark: | N/A | |
| `provider_name` | [components.ProviderName](../components/providername.md) | :heavy_check_mark: | N/A | OpenAI |
| `tag` | *str* | :heavy_check_mark: | N/A | |
| `quantization` | [Nullable[components.PublicEndpointQuantization]](../components/publicendpointquantization.md) | :heavy_check_mark: | N/A | fp16 |
| `max_completion_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `max_prompt_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | N/A | |
| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 |
| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | |
| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | |
| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | N/A | |
+11
View File
@@ -0,0 +1,11 @@
# ResponseInputVideo
Video input content item
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `type` | [components.ResponseInputVideoType](../components/responseinputvideotype.md) | :heavy_check_mark: | N/A |
| `video_url` | *str* | :heavy_check_mark: | A base64 data URL or remote URL that resolves to a video file |
@@ -0,0 +1,8 @@
# ResponseInputVideoType
## Values
| Name | Value |
| ------------- | ------------- |
| `INPUT_VIDEO` | input_video |
+2 -1
View File
@@ -7,4 +7,5 @@
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A |
| `text` | *str* | :heavy_check_mark: | N/A |
| `annotations` | List[[components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.md)] | :heavy_minus_sign: | N/A |
| `annotations` | List[[components.OpenAIResponsesAnnotation](../components/openairesponsesannotation.md)] | :heavy_minus_sign: | N/A |
| `logprobs` | List[[components.Logprob](../components/logprob.md)] | :heavy_minus_sign: | N/A |
@@ -1,4 +1,4 @@
# TopLogprob
# ResponseOutputTextTopLogprob
## Fields
@@ -6,5 +6,5 @@
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
@@ -5,11 +5,13 @@ An output item containing reasoning
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | N/A |
| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A |
| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `status` | [Optional[components.ResponsesOutputItemReasoningStatusUnion]](../components/responsesoutputitemreasoningstatusunion.md) | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A | |
| `id` | *str* | :heavy_check_mark: | N/A | |
| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | N/A | |
| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A | |
| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `status` | [Optional[components.ResponsesOutputItemReasoningStatusUnion]](../components/responsesoutputitemreasoningstatusunion.md) | :heavy_minus_sign: | N/A | |
| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... |
| `format_` | [OptionalNullable[components.ResponsesOutputItemReasoningFormat]](../components/responsesoutputitemreasoningformat.md) | :heavy_minus_sign: | The format of the reasoning content | anthropic-claude-v1 |
@@ -0,0 +1,15 @@
# ResponsesOutputItemReasoningFormat
The format of the reasoning content
## Values
| Name | Value |
| --------------------------- | --------------------------- |
| `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 |
@@ -0,0 +1,9 @@
# ResponsesOutputModality
## Values
| Name | Value |
| ------- | ------- |
| `TEXT` | text |
| `IMAGE` | image |
+3 -2
View File
@@ -31,12 +31,12 @@
| `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq |
| `HYPERBOLIC` | Hyperbolic |
| `INCEPTION` | Inception |
| `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic |
| `INFLECTION` | Inflection |
@@ -61,13 +61,14 @@
| `PHALA` | Phala |
| `RELACE` | Relace |
| `SAMBA_NOVA` | SambaNova |
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful |
| `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon |
| `TOGETHER` | Together |
| `UPSTAGE` | Upstage |
| `VENICE` | Venice |
| `WAND_B` | WandB |
| `XIAOMI` | Xiaomi |
+8 -7
View File
@@ -3,10 +3,11 @@
## Values
| Name | Value |
| --------------------- | --------------------- |
| `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 |
| Name | Value |
| --------------------------- | --------------------------- |
| `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 |
+2 -1
View File
@@ -38,4 +38,5 @@ Generation data
| `is_byok` | *bool* | :heavy_check_mark: | Whether this used bring-your-own-key | false |
| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | Native finish reason as reported by provider | stop |
| `external_user` | *Nullable[str]* | :heavy_check_mark: | External user identifier | user-123 |
| `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | |
| `api_type` | [Nullable[operations.APIType]](../operations/apitype.md) | :heavy_check_mark: | Type of API used for the generation | |
| `router` | *Nullable[str]* | :heavy_check_mark: | Router used for the request (e.g., openrouter/auto) | openrouter/auto |
File diff suppressed because one or more lines are too long
+2
View File
@@ -63,6 +63,8 @@ with OpenRouter(
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response
+6
View File
@@ -51,7 +51,13 @@ with OpenRouter(
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `max_tool_calls` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {<br/>"aspect_ratio": "16:9"<br/>} |
| `modalities` | List[[components.ResponsesOutputModality](../../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [<br/>"text",<br/>"image"<br/>] |
| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | |
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "openrouter"
version = "0.0.17"
version = "0.0.18"
description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata
__title__: str = "openrouter"
__version__: str = "0.0.17"
__version__: str = "0.0.18"
__openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.0.17 2.768.0 1.0.0 openrouter"
__user_agent__: str = "speakeasy-sdk/python 0.0.18 2.768.0 1.0.0 openrouter"
try:
if __package__ is not None:
+58
View File
@@ -76,6 +76,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -112,6 +119,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -179,6 +188,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -215,6 +231,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -281,6 +299,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -317,6 +342,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -374,6 +401,8 @@ class Chat(BaseSDK):
),
top_p=top_p,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
image_config=image_config,
modalities=modalities,
)
req = self._build_request(
@@ -523,6 +552,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -559,6 +595,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -626,6 +664,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -662,6 +707,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -728,6 +775,13 @@ class Chat(BaseSDK):
] = None,
top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
image_config: Optional[
Union[
Dict[str, components.ChatGenerationParamsImageConfig],
Dict[str, components.ChatGenerationParamsImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.Modality]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
@@ -764,6 +818,8 @@ class Chat(BaseSDK):
:param tools:
:param top_p:
:param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -821,6 +877,8 @@ class Chat(BaseSDK):
),
top_p=top_p,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
image_config=image_config,
modalities=modalities,
)
req = self._build_request_async(
+171 -30
View File
@@ -38,8 +38,12 @@ if TYPE_CHECKING:
from .chatgenerationparams import (
ChatGenerationParams,
ChatGenerationParamsDataCollection,
ChatGenerationParamsImageConfig,
ChatGenerationParamsImageConfigTypedDict,
ChatGenerationParamsMaxPrice,
ChatGenerationParamsMaxPriceTypedDict,
ChatGenerationParamsPluginAutoRouter,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParser,
ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginModeration,
@@ -50,6 +54,14 @@ if TYPE_CHECKING:
ChatGenerationParamsPluginUnionTypedDict,
ChatGenerationParamsPluginWeb,
ChatGenerationParamsPluginWebTypedDict,
ChatGenerationParamsPreferredMaxLatency,
ChatGenerationParamsPreferredMaxLatencyTypedDict,
ChatGenerationParamsPreferredMaxLatencyUnion,
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict,
ChatGenerationParamsPreferredMinThroughput,
ChatGenerationParamsPreferredMinThroughputTypedDict,
ChatGenerationParamsPreferredMinThroughputUnion,
ChatGenerationParamsPreferredMinThroughputUnionTypedDict,
ChatGenerationParamsProvider,
ChatGenerationParamsProviderTypedDict,
ChatGenerationParamsResponseFormatJSONObject,
@@ -67,6 +79,7 @@ if TYPE_CHECKING:
DebugTypedDict,
Effort,
Engine,
Modality,
Pdf,
PdfEngine,
PdfTypedDict,
@@ -123,9 +136,9 @@ if TYPE_CHECKING:
)
from .chatmessagetokenlogprob import (
ChatMessageTokenLogprob,
ChatMessageTokenLogprobTopLogprob,
ChatMessageTokenLogprobTopLogprobTypedDict,
ChatMessageTokenLogprobTypedDict,
TopLogprob,
TopLogprobTypedDict,
)
from .chatmessagetokenlogprobs import (
ChatMessageTokenLogprobs,
@@ -333,17 +346,21 @@ if TYPE_CHECKING:
from .openairesponsestruncation import OpenAIResponsesTruncation
from .openresponseseasyinputmessage import (
OpenResponsesEasyInputMessage,
OpenResponsesEasyInputMessageContent1,
OpenResponsesEasyInputMessageContent1TypedDict,
OpenResponsesEasyInputMessageContent2,
OpenResponsesEasyInputMessageContent2TypedDict,
OpenResponsesEasyInputMessageContentInputImage,
OpenResponsesEasyInputMessageContentInputImageTypedDict,
OpenResponsesEasyInputMessageContentType,
OpenResponsesEasyInputMessageContentUnion1,
OpenResponsesEasyInputMessageContentUnion1TypedDict,
OpenResponsesEasyInputMessageContentUnion2,
OpenResponsesEasyInputMessageContentUnion2TypedDict,
OpenResponsesEasyInputMessageDetail,
OpenResponsesEasyInputMessageRoleAssistant,
OpenResponsesEasyInputMessageRoleDeveloper,
OpenResponsesEasyInputMessageRoleSystem,
OpenResponsesEasyInputMessageRoleUnion,
OpenResponsesEasyInputMessageRoleUnionTypedDict,
OpenResponsesEasyInputMessageRoleUser,
OpenResponsesEasyInputMessageType,
OpenResponsesEasyInputMessageTypeMessage,
OpenResponsesEasyInputMessageTypedDict,
)
from .openresponseserrorevent import (
@@ -389,14 +406,18 @@ if TYPE_CHECKING:
)
from .openresponsesinputmessageitem import (
OpenResponsesInputMessageItem,
OpenResponsesInputMessageItemContent,
OpenResponsesInputMessageItemContentTypedDict,
OpenResponsesInputMessageItemContentInputImage,
OpenResponsesInputMessageItemContentInputImageTypedDict,
OpenResponsesInputMessageItemContentType,
OpenResponsesInputMessageItemContentUnion,
OpenResponsesInputMessageItemContentUnionTypedDict,
OpenResponsesInputMessageItemDetail,
OpenResponsesInputMessageItemRoleDeveloper,
OpenResponsesInputMessageItemRoleSystem,
OpenResponsesInputMessageItemRoleUnion,
OpenResponsesInputMessageItemRoleUnionTypedDict,
OpenResponsesInputMessageItemRoleUser,
OpenResponsesInputMessageItemType,
OpenResponsesInputMessageItemTypeMessage,
OpenResponsesInputMessageItemTypedDict,
)
from .openresponseslogprobs import (
@@ -454,6 +475,7 @@ if TYPE_CHECKING:
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
)
from .openresponsesrequest import (
IDAutoRouter,
IDFileParser,
IDModeration,
IDResponseHealing,
@@ -461,12 +483,16 @@ if TYPE_CHECKING:
OpenResponsesRequest,
OpenResponsesRequestIgnore,
OpenResponsesRequestIgnoreTypedDict,
OpenResponsesRequestImageConfig,
OpenResponsesRequestImageConfigTypedDict,
OpenResponsesRequestMaxPrice,
OpenResponsesRequestMaxPriceTypedDict,
OpenResponsesRequestOnly,
OpenResponsesRequestOnlyTypedDict,
OpenResponsesRequestOrder,
OpenResponsesRequestOrderTypedDict,
OpenResponsesRequestPluginAutoRouter,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParser,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginModeration,
@@ -622,7 +648,21 @@ if TYPE_CHECKING:
)
from .pdfparserengine import PDFParserEngine
from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict
from .percentilelatencycutoffs import (
PercentileLatencyCutoffs,
PercentileLatencyCutoffsTypedDict,
)
from .percentilestats import PercentileStats, PercentileStatsTypedDict
from .percentilethroughputcutoffs import (
PercentileThroughputCutoffs,
PercentileThroughputCutoffsTypedDict,
)
from .perrequestlimits import PerRequestLimits, PerRequestLimitsTypedDict
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName
from .provideroverloadedresponseerrordata import (
ProviderOverloadedResponseErrorData,
@@ -717,8 +757,17 @@ if TYPE_CHECKING:
ResponseInputTextType,
ResponseInputTextTypedDict,
)
from .responseinputvideo import (
ResponseInputVideo,
ResponseInputVideoType,
ResponseInputVideoTypedDict,
)
from .responseoutputtext import (
Logprob,
LogprobTypedDict,
ResponseOutputText,
ResponseOutputTextTopLogprob,
ResponseOutputTextTopLogprobTypedDict,
ResponseOutputTextType,
ResponseOutputTextTypedDict,
)
@@ -765,6 +814,7 @@ if TYPE_CHECKING:
)
from .responsesoutputitemreasoning import (
ResponsesOutputItemReasoning,
ResponsesOutputItemReasoningFormat,
ResponsesOutputItemReasoningStatusCompleted,
ResponsesOutputItemReasoningStatusInProgress,
ResponsesOutputItemReasoningStatusIncomplete,
@@ -786,6 +836,7 @@ if TYPE_CHECKING:
ResponsesOutputMessageType,
ResponsesOutputMessageTypedDict,
)
from .responsesoutputmodality import ResponsesOutputModality
from .responsessearchcontextsize import ResponsesSearchContextSize
from .responseswebsearchcalloutput import (
ResponsesWebSearchCallOutput,
@@ -873,8 +924,12 @@ __all__ = [
"ChatErrorErrorTypedDict",
"ChatGenerationParams",
"ChatGenerationParamsDataCollection",
"ChatGenerationParamsImageConfig",
"ChatGenerationParamsImageConfigTypedDict",
"ChatGenerationParamsMaxPrice",
"ChatGenerationParamsMaxPriceTypedDict",
"ChatGenerationParamsPluginAutoRouter",
"ChatGenerationParamsPluginAutoRouterTypedDict",
"ChatGenerationParamsPluginFileParser",
"ChatGenerationParamsPluginFileParserTypedDict",
"ChatGenerationParamsPluginModeration",
@@ -885,6 +940,14 @@ __all__ = [
"ChatGenerationParamsPluginUnionTypedDict",
"ChatGenerationParamsPluginWeb",
"ChatGenerationParamsPluginWebTypedDict",
"ChatGenerationParamsPreferredMaxLatency",
"ChatGenerationParamsPreferredMaxLatencyTypedDict",
"ChatGenerationParamsPreferredMaxLatencyUnion",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
"ChatGenerationParamsPreferredMinThroughput",
"ChatGenerationParamsPreferredMinThroughputTypedDict",
"ChatGenerationParamsPreferredMinThroughputUnion",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
"ChatGenerationParamsProvider",
"ChatGenerationParamsProviderTypedDict",
"ChatGenerationParamsResponseFormatJSONObject",
@@ -920,6 +983,8 @@ __all__ = [
"ChatMessageContentItemVideoVideoURL",
"ChatMessageContentItemVideoVideoURLTypedDict",
"ChatMessageTokenLogprob",
"ChatMessageTokenLogprobTopLogprob",
"ChatMessageTokenLogprobTopLogprobTypedDict",
"ChatMessageTokenLogprobTypedDict",
"ChatMessageTokenLogprobs",
"ChatMessageTokenLogprobsTypedDict",
@@ -996,6 +1061,7 @@ __all__ = [
"FilePathTypedDict",
"ForbiddenResponseErrorData",
"ForbiddenResponseErrorDataTypedDict",
"IDAutoRouter",
"IDFileParser",
"IDModeration",
"IDResponseHealing",
@@ -1013,12 +1079,15 @@ __all__ = [
"JSONSchemaConfigTypedDict",
"ListEndpointsResponse",
"ListEndpointsResponseTypedDict",
"Logprob",
"LogprobTypedDict",
"Message",
"MessageContent",
"MessageContentTypedDict",
"MessageDeveloper",
"MessageDeveloperTypedDict",
"MessageTypedDict",
"Modality",
"Model",
"ModelArchitecture",
"ModelArchitectureInstructType",
@@ -1100,17 +1169,21 @@ __all__ = [
"OpenAIResponsesToolChoiceUnionTypedDict",
"OpenAIResponsesTruncation",
"OpenResponsesEasyInputMessage",
"OpenResponsesEasyInputMessageContent1",
"OpenResponsesEasyInputMessageContent1TypedDict",
"OpenResponsesEasyInputMessageContent2",
"OpenResponsesEasyInputMessageContent2TypedDict",
"OpenResponsesEasyInputMessageContentInputImage",
"OpenResponsesEasyInputMessageContentInputImageTypedDict",
"OpenResponsesEasyInputMessageContentType",
"OpenResponsesEasyInputMessageContentUnion1",
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
"OpenResponsesEasyInputMessageContentUnion2",
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
"OpenResponsesEasyInputMessageDetail",
"OpenResponsesEasyInputMessageRoleAssistant",
"OpenResponsesEasyInputMessageRoleDeveloper",
"OpenResponsesEasyInputMessageRoleSystem",
"OpenResponsesEasyInputMessageRoleUnion",
"OpenResponsesEasyInputMessageRoleUnionTypedDict",
"OpenResponsesEasyInputMessageRoleUser",
"OpenResponsesEasyInputMessageType",
"OpenResponsesEasyInputMessageTypeMessage",
"OpenResponsesEasyInputMessageTypedDict",
"OpenResponsesErrorEvent",
"OpenResponsesErrorEventType",
@@ -1137,14 +1210,18 @@ __all__ = [
"OpenResponsesInput1",
"OpenResponsesInput1TypedDict",
"OpenResponsesInputMessageItem",
"OpenResponsesInputMessageItemContent",
"OpenResponsesInputMessageItemContentTypedDict",
"OpenResponsesInputMessageItemContentInputImage",
"OpenResponsesInputMessageItemContentInputImageTypedDict",
"OpenResponsesInputMessageItemContentType",
"OpenResponsesInputMessageItemContentUnion",
"OpenResponsesInputMessageItemContentUnionTypedDict",
"OpenResponsesInputMessageItemDetail",
"OpenResponsesInputMessageItemRoleDeveloper",
"OpenResponsesInputMessageItemRoleSystem",
"OpenResponsesInputMessageItemRoleUnion",
"OpenResponsesInputMessageItemRoleUnionTypedDict",
"OpenResponsesInputMessageItemRoleUser",
"OpenResponsesInputMessageItemType",
"OpenResponsesInputMessageItemTypeMessage",
"OpenResponsesInputMessageItemTypedDict",
"OpenResponsesInputTypedDict",
"OpenResponsesLogProbs",
@@ -1185,12 +1262,16 @@ __all__ = [
"OpenResponsesRequest",
"OpenResponsesRequestIgnore",
"OpenResponsesRequestIgnoreTypedDict",
"OpenResponsesRequestImageConfig",
"OpenResponsesRequestImageConfigTypedDict",
"OpenResponsesRequestMaxPrice",
"OpenResponsesRequestMaxPriceTypedDict",
"OpenResponsesRequestOnly",
"OpenResponsesRequestOnlyTypedDict",
"OpenResponsesRequestOrder",
"OpenResponsesRequestOrderTypedDict",
"OpenResponsesRequestPluginAutoRouter",
"OpenResponsesRequestPluginAutoRouterTypedDict",
"OpenResponsesRequestPluginFileParser",
"OpenResponsesRequestPluginFileParserTypedDict",
"OpenResponsesRequestPluginModeration",
@@ -1305,6 +1386,16 @@ __all__ = [
"PdfTypedDict",
"PerRequestLimits",
"PerRequestLimitsTypedDict",
"PercentileLatencyCutoffs",
"PercentileLatencyCutoffsTypedDict",
"PercentileStats",
"PercentileStatsTypedDict",
"PercentileThroughputCutoffs",
"PercentileThroughputCutoffsTypedDict",
"PreferredMaxLatency",
"PreferredMaxLatencyTypedDict",
"PreferredMinThroughput",
"PreferredMinThroughputTypedDict",
"Pricing",
"PricingTypedDict",
"Prompt",
@@ -1379,7 +1470,12 @@ __all__ = [
"ResponseInputText",
"ResponseInputTextType",
"ResponseInputTextTypedDict",
"ResponseInputVideo",
"ResponseInputVideoType",
"ResponseInputVideoTypedDict",
"ResponseOutputText",
"ResponseOutputTextTopLogprob",
"ResponseOutputTextTopLogprobTypedDict",
"ResponseOutputTextType",
"ResponseOutputTextTypedDict",
"ResponseTextConfig",
@@ -1412,6 +1508,7 @@ __all__ = [
"ResponsesOutputItemFunctionCallType",
"ResponsesOutputItemFunctionCallTypedDict",
"ResponsesOutputItemReasoning",
"ResponsesOutputItemReasoningFormat",
"ResponsesOutputItemReasoningStatusCompleted",
"ResponsesOutputItemReasoningStatusInProgress",
"ResponsesOutputItemReasoningStatusIncomplete",
@@ -1431,6 +1528,7 @@ __all__ = [
"ResponsesOutputMessageStatusUnionTypedDict",
"ResponsesOutputMessageType",
"ResponsesOutputMessageTypedDict",
"ResponsesOutputModality",
"ResponsesSearchContextSize",
"ResponsesWebSearchCallOutput",
"ResponsesWebSearchCallOutputType",
@@ -1476,8 +1574,6 @@ __all__ = [
"ToolResponseMessageContent",
"ToolResponseMessageContentTypedDict",
"ToolResponseMessageTypedDict",
"TopLogprob",
"TopLogprobTypedDict",
"TopProviderInfo",
"TopProviderInfoTypedDict",
"Truncation",
@@ -1554,8 +1650,12 @@ _dynamic_imports: dict[str, str] = {
"CodeTypedDict": ".chaterror",
"ChatGenerationParams": ".chatgenerationparams",
"ChatGenerationParamsDataCollection": ".chatgenerationparams",
"ChatGenerationParamsImageConfig": ".chatgenerationparams",
"ChatGenerationParamsImageConfigTypedDict": ".chatgenerationparams",
"ChatGenerationParamsMaxPrice": ".chatgenerationparams",
"ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginModeration": ".chatgenerationparams",
@@ -1566,6 +1666,14 @@ _dynamic_imports: dict[str, str] = {
"ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginWeb": ".chatgenerationparams",
"ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatency": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughput": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsProvider": ".chatgenerationparams",
"ChatGenerationParamsProviderTypedDict": ".chatgenerationparams",
"ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams",
@@ -1583,6 +1691,7 @@ _dynamic_imports: dict[str, str] = {
"DebugTypedDict": ".chatgenerationparams",
"Effort": ".chatgenerationparams",
"Engine": ".chatgenerationparams",
"Modality": ".chatgenerationparams",
"Pdf": ".chatgenerationparams",
"PdfEngine": ".chatgenerationparams",
"PdfTypedDict": ".chatgenerationparams",
@@ -1623,9 +1732,9 @@ _dynamic_imports: dict[str, str] = {
"VideoURL2": ".chatmessagecontentitemvideo",
"VideoURL2TypedDict": ".chatmessagecontentitemvideo",
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTopLogprob": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTopLogprobTypedDict": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
"TopLogprob": ".chatmessagetokenlogprob",
"TopLogprobTypedDict": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs",
"ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs",
"ChatMessageToolCall": ".chatmessagetoolcall",
@@ -1798,17 +1907,21 @@ _dynamic_imports: dict[str, str] = {
"TypeTypedDict": ".openairesponsestoolchoice_union",
"OpenAIResponsesTruncation": ".openairesponsestruncation",
"OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent1": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent1TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent2": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent2TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentInputImage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentInputImageTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentType": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion1": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion1TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion2": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion2TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageDetail": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageType": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageTypeMessage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesErrorEvent": ".openresponseserrorevent",
"OpenResponsesErrorEventType": ".openresponseserrorevent",
@@ -1836,14 +1949,18 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesInput1TypedDict": ".openresponsesinput",
"OpenResponsesInputTypedDict": ".openresponsesinput",
"OpenResponsesInputMessageItem": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContent": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentInputImage": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentInputImageTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentType": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentUnion": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentUnionTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemDetail": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemType": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemTypeMessage": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesLogProbs": ".openresponseslogprobs",
"OpenResponsesLogProbsTypedDict": ".openresponseslogprobs",
@@ -1881,6 +1998,7 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesReasoningSummaryTextDoneEvent": ".openresponsesreasoningsummarytextdoneevent",
"OpenResponsesReasoningSummaryTextDoneEventType": ".openresponsesreasoningsummarytextdoneevent",
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
"IDAutoRouter": ".openresponsesrequest",
"IDFileParser": ".openresponsesrequest",
"IDModeration": ".openresponsesrequest",
"IDResponseHealing": ".openresponsesrequest",
@@ -1888,12 +2006,16 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesRequest": ".openresponsesrequest",
"OpenResponsesRequestIgnore": ".openresponsesrequest",
"OpenResponsesRequestIgnoreTypedDict": ".openresponsesrequest",
"OpenResponsesRequestImageConfig": ".openresponsesrequest",
"OpenResponsesRequestImageConfigTypedDict": ".openresponsesrequest",
"OpenResponsesRequestMaxPrice": ".openresponsesrequest",
"OpenResponsesRequestMaxPriceTypedDict": ".openresponsesrequest",
"OpenResponsesRequestOnly": ".openresponsesrequest",
"OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest",
"OpenResponsesRequestOrder": ".openresponsesrequest",
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginModeration": ".openresponsesrequest",
@@ -2025,8 +2147,18 @@ _dynamic_imports: dict[str, str] = {
"PDFParserEngine": ".pdfparserengine",
"PDFParserOptions": ".pdfparseroptions",
"PDFParserOptionsTypedDict": ".pdfparseroptions",
"PercentileLatencyCutoffs": ".percentilelatencycutoffs",
"PercentileLatencyCutoffsTypedDict": ".percentilelatencycutoffs",
"PercentileStats": ".percentilestats",
"PercentileStatsTypedDict": ".percentilestats",
"PercentileThroughputCutoffs": ".percentilethroughputcutoffs",
"PercentileThroughputCutoffsTypedDict": ".percentilethroughputcutoffs",
"PerRequestLimits": ".perrequestlimits",
"PerRequestLimitsTypedDict": ".perrequestlimits",
"PreferredMaxLatency": ".preferredmaxlatency",
"PreferredMaxLatencyTypedDict": ".preferredmaxlatency",
"PreferredMinThroughput": ".preferredminthroughput",
"PreferredMinThroughputTypedDict": ".preferredminthroughput",
"ProviderName": ".providername",
"ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata",
"ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata",
@@ -2095,7 +2227,14 @@ _dynamic_imports: dict[str, str] = {
"ResponseInputText": ".responseinputtext",
"ResponseInputTextType": ".responseinputtext",
"ResponseInputTextTypedDict": ".responseinputtext",
"ResponseInputVideo": ".responseinputvideo",
"ResponseInputVideoType": ".responseinputvideo",
"ResponseInputVideoTypedDict": ".responseinputvideo",
"Logprob": ".responseoutputtext",
"LogprobTypedDict": ".responseoutputtext",
"ResponseOutputText": ".responseoutputtext",
"ResponseOutputTextTopLogprob": ".responseoutputtext",
"ResponseOutputTextTopLogprobTypedDict": ".responseoutputtext",
"ResponseOutputTextType": ".responseoutputtext",
"ResponseOutputTextTypedDict": ".responseoutputtext",
"CodeEnum": ".responseserrorfield",
@@ -2127,6 +2266,7 @@ _dynamic_imports: dict[str, str] = {
"ResponsesOutputItemFunctionCallType": ".responsesoutputitemfunctioncall",
"ResponsesOutputItemFunctionCallTypedDict": ".responsesoutputitemfunctioncall",
"ResponsesOutputItemReasoning": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningFormat": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusCompleted": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusInProgress": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusIncomplete": ".responsesoutputitemreasoning",
@@ -2145,6 +2285,7 @@ _dynamic_imports: dict[str, str] = {
"ResponsesOutputMessageStatusUnionTypedDict": ".responsesoutputmessage",
"ResponsesOutputMessageType": ".responsesoutputmessage",
"ResponsesOutputMessageTypedDict": ".responsesoutputmessage",
"ResponsesOutputModality": ".responsesoutputmodality",
"ResponsesSearchContextSize": ".responsessearchcontextsize",
"ResponsesWebSearchCallOutput": ".responseswebsearchcalloutput",
"ResponsesWebSearchCallOutputType": ".responseswebsearchcalloutput",
+3 -2
View File
@@ -36,12 +36,12 @@ Schema0Enum = Union[
"Fireworks",
"Friendli",
"GMICloud",
"GoPomelo",
"Google",
"Google AI Studio",
"Groq",
"Hyperbolic",
"Inception",
"Inceptron",
"InferenceNet",
"Infermatic",
"Inflection",
@@ -66,13 +66,14 @@ Schema0Enum = Union[
"Phala",
"Relace",
"SambaNova",
"Seed",
"SiliconFlow",
"Sourceful",
"Stealth",
"StreamLake",
"Switchpoint",
"Targon",
"Together",
"Upstage",
"Venice",
"WandB",
"Xiaomi",
+1
View File
@@ -21,6 +21,7 @@ Schema5 = Union[
Literal[
"unknown",
"openai-responses-v1",
"azure-openai-responses-v1",
"xai-responses-v1",
"anthropic-claude-v1",
"google-gemini-v1",
+184 -14
View File
@@ -80,6 +80,124 @@ class ChatGenerationParamsMaxPrice(BaseModel):
request: Optional[Any] = None
class ChatGenerationParamsPreferredMinThroughputTypedDict(TypedDict):
p50: NotRequired[Nullable[float]]
p75: NotRequired[Nullable[float]]
p90: NotRequired[Nullable[float]]
p99: NotRequired[Nullable[float]]
class ChatGenerationParamsPreferredMinThroughput(BaseModel):
p50: OptionalNullable[float] = UNSET
p75: OptionalNullable[float] = UNSET
p90: OptionalNullable[float] = UNSET
p99: OptionalNullable[float] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
ChatGenerationParamsPreferredMinThroughputUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
Union[ChatGenerationParamsPreferredMinThroughputTypedDict, float],
)
ChatGenerationParamsPreferredMinThroughputUnion = TypeAliasType(
"ChatGenerationParamsPreferredMinThroughputUnion",
Union[ChatGenerationParamsPreferredMinThroughput, float],
)
class ChatGenerationParamsPreferredMaxLatencyTypedDict(TypedDict):
p50: NotRequired[Nullable[float]]
p75: NotRequired[Nullable[float]]
p90: NotRequired[Nullable[float]]
p99: NotRequired[Nullable[float]]
class ChatGenerationParamsPreferredMaxLatency(BaseModel):
p50: OptionalNullable[float] = UNSET
p75: OptionalNullable[float] = UNSET
p90: OptionalNullable[float] = UNSET
p99: OptionalNullable[float] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
Union[ChatGenerationParamsPreferredMaxLatencyTypedDict, float],
)
ChatGenerationParamsPreferredMaxLatencyUnion = TypeAliasType(
"ChatGenerationParamsPreferredMaxLatencyUnion",
Union[ChatGenerationParamsPreferredMaxLatency, float],
)
class ChatGenerationParamsProviderTypedDict(TypedDict):
allow_fallbacks: NotRequired[Nullable[bool]]
r"""Whether to allow backup providers to serve requests
@@ -109,10 +227,14 @@ class ChatGenerationParamsProviderTypedDict(TypedDict):
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: NotRequired[ChatGenerationParamsMaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: NotRequired[Nullable[float]]
preferred_max_latency: NotRequired[Nullable[float]]
min_throughput: NotRequired[Nullable[float]]
max_latency: NotRequired[Nullable[float]]
preferred_min_throughput: NotRequired[
Nullable[ChatGenerationParamsPreferredMinThroughputUnionTypedDict]
]
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[
Nullable[ChatGenerationParamsPreferredMaxLatencyUnionTypedDict]
]
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
class ChatGenerationParamsProvider(BaseModel):
@@ -160,13 +282,15 @@ class ChatGenerationParamsProvider(BaseModel):
max_price: Optional[ChatGenerationParamsMaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: OptionalNullable[float] = UNSET
preferred_min_throughput: OptionalNullable[
ChatGenerationParamsPreferredMinThroughputUnion
] = UNSET
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: OptionalNullable[float] = UNSET
min_throughput: OptionalNullable[float] = UNSET
max_latency: OptionalNullable[float] = UNSET
preferred_max_latency: OptionalNullable[
ChatGenerationParamsPreferredMaxLatencyUnion
] = UNSET
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -184,8 +308,6 @@ class ChatGenerationParamsProvider(BaseModel):
"max_price",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
nullable_fields = [
"allow_fallbacks",
@@ -200,8 +322,6 @@ class ChatGenerationParamsProvider(BaseModel):
"sort",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
null_default_fields = []
@@ -331,11 +451,31 @@ class ChatGenerationParamsPluginModeration(BaseModel):
] = "moderation"
class ChatGenerationParamsPluginAutoRouterTypedDict(TypedDict):
id: Literal["auto-router"]
enabled: NotRequired[bool]
allowed_models: NotRequired[List[str]]
class ChatGenerationParamsPluginAutoRouter(BaseModel):
ID: Annotated[
Annotated[
Literal["auto-router"], AfterValidator(validate_const("auto-router"))
],
pydantic.Field(alias="id"),
] = "auto-router"
enabled: Optional[bool] = None
allowed_models: Optional[List[str]] = None
ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
"ChatGenerationParamsPluginUnionTypedDict",
Union[
ChatGenerationParamsPluginModerationTypedDict,
ChatGenerationParamsPluginResponseHealingTypedDict,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginWebTypedDict,
],
@@ -344,6 +484,7 @@ ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
ChatGenerationParamsPluginUnion = Annotated[
Union[
Annotated[ChatGenerationParamsPluginAutoRouter, Tag("auto-router")],
Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")],
Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
@@ -498,6 +639,25 @@ class Debug(BaseModel):
echo_upstream_body: Optional[bool] = None
ChatGenerationParamsImageConfigTypedDict = TypeAliasType(
"ChatGenerationParamsImageConfigTypedDict", Union[str, float]
)
ChatGenerationParamsImageConfig = TypeAliasType(
"ChatGenerationParamsImageConfig", Union[str, float]
)
Modality = Union[
Literal[
"text",
"image",
],
UnrecognizedStr,
]
class ChatGenerationParamsTypedDict(TypedDict):
messages: List[MessageTypedDict]
provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]]
@@ -529,6 +689,8 @@ class ChatGenerationParamsTypedDict(TypedDict):
tools: NotRequired[List[ToolDefinitionJSONTypedDict]]
top_p: NotRequired[Nullable[float]]
debug: NotRequired[DebugTypedDict]
image_config: NotRequired[Dict[str, ChatGenerationParamsImageConfigTypedDict]]
modalities: NotRequired[List[Modality]]
class ChatGenerationParams(BaseModel):
@@ -591,6 +753,12 @@ class ChatGenerationParams(BaseModel):
debug: Optional[Debug] = None
image_config: Optional[Dict[str, ChatGenerationParamsImageConfig]] = None
modalities: Optional[
List[Annotated[Modality, PlainValidator(validate_open_enum(False))]]
] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
@@ -620,6 +788,8 @@ class ChatGenerationParams(BaseModel):
"tools",
"top_p",
"debug",
"image_config",
"modalities",
]
nullable_fields = [
"provider",
@@ -72,6 +72,7 @@ class CompletionTokensDetails(BaseModel):
class PromptTokensDetailsTypedDict(TypedDict):
cached_tokens: NotRequired[float]
cache_write_tokens: NotRequired[float]
audio_tokens: NotRequired[float]
video_tokens: NotRequired[float]
@@ -79,6 +80,8 @@ class PromptTokensDetailsTypedDict(TypedDict):
class PromptTokensDetails(BaseModel):
cached_tokens: Optional[float] = None
cache_write_tokens: Optional[float] = None
audio_tokens: Optional[float] = None
video_tokens: Optional[float] = None
@@ -8,13 +8,13 @@ from typing import List
from typing_extensions import Annotated, TypedDict
class TopLogprobTypedDict(TypedDict):
class ChatMessageTokenLogprobTopLogprobTypedDict(TypedDict):
token: str
logprob: float
bytes_: Nullable[List[float]]
class TopLogprob(BaseModel):
class ChatMessageTokenLogprobTopLogprob(BaseModel):
token: str
logprob: float
@@ -56,7 +56,7 @@ class ChatMessageTokenLogprobTypedDict(TypedDict):
token: str
logprob: float
bytes_: Nullable[List[float]]
top_logprobs: List[TopLogprobTypedDict]
top_logprobs: List[ChatMessageTokenLogprobTopLogprobTypedDict]
class ChatMessageTokenLogprob(BaseModel):
@@ -66,7 +66,7 @@ class ChatMessageTokenLogprob(BaseModel):
bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
top_logprobs: List[TopLogprob]
top_logprobs: List[ChatMessageTokenLogprobTopLogprob]
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -3,16 +3,24 @@
from __future__ import annotations
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
from openrouter.types import BaseModel
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import get_discriminator, validate_open_enum
from pydantic import Discriminator, Tag, model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
OpenResponsesEasyInputMessageType = Literal["message",]
OpenResponsesEasyInputMessageTypeMessage = Literal["message",]
OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]
@@ -49,49 +57,114 @@ OpenResponsesEasyInputMessageRoleUnion = TypeAliasType(
)
OpenResponsesEasyInputMessageContent1TypedDict = TypeAliasType(
"OpenResponsesEasyInputMessageContent1TypedDict",
OpenResponsesEasyInputMessageContentType = Literal["input_image",]
OpenResponsesEasyInputMessageDetail = Union[
Literal[
"auto",
"high",
"low",
],
UnrecognizedStr,
]
class OpenResponsesEasyInputMessageContentInputImageTypedDict(TypedDict):
r"""Image input content item"""
type: OpenResponsesEasyInputMessageContentType
detail: OpenResponsesEasyInputMessageDetail
image_url: NotRequired[Nullable[str]]
class OpenResponsesEasyInputMessageContentInputImage(BaseModel):
r"""Image input content item"""
type: OpenResponsesEasyInputMessageContentType
detail: Annotated[
OpenResponsesEasyInputMessageDetail, PlainValidator(validate_open_enum(False))
]
image_url: OptionalNullable[str] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["image_url"]
nullable_fields = ["image_url"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
OpenResponsesEasyInputMessageContentUnion1TypedDict = TypeAliasType(
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
Union[
ResponseInputTextTypedDict,
ResponseInputAudioTypedDict,
ResponseInputImageTypedDict,
ResponseInputVideoTypedDict,
OpenResponsesEasyInputMessageContentInputImageTypedDict,
ResponseInputFileTypedDict,
],
)
OpenResponsesEasyInputMessageContent1 = Annotated[
OpenResponsesEasyInputMessageContentUnion1 = Annotated[
Union[
Annotated[ResponseInputText, Tag("input_text")],
Annotated[ResponseInputImage, Tag("input_image")],
Annotated[OpenResponsesEasyInputMessageContentInputImage, Tag("input_image")],
Annotated[ResponseInputFile, Tag("input_file")],
Annotated[ResponseInputAudio, Tag("input_audio")],
Annotated[ResponseInputVideo, Tag("input_video")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
OpenResponsesEasyInputMessageContent2TypedDict = TypeAliasType(
"OpenResponsesEasyInputMessageContent2TypedDict",
Union[List[OpenResponsesEasyInputMessageContent1TypedDict], str],
OpenResponsesEasyInputMessageContentUnion2TypedDict = TypeAliasType(
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str],
)
OpenResponsesEasyInputMessageContent2 = TypeAliasType(
"OpenResponsesEasyInputMessageContent2",
Union[List[OpenResponsesEasyInputMessageContent1], str],
OpenResponsesEasyInputMessageContentUnion2 = TypeAliasType(
"OpenResponsesEasyInputMessageContentUnion2",
Union[List[OpenResponsesEasyInputMessageContentUnion1], str],
)
class OpenResponsesEasyInputMessageTypedDict(TypedDict):
role: OpenResponsesEasyInputMessageRoleUnionTypedDict
content: OpenResponsesEasyInputMessageContent2TypedDict
type: NotRequired[OpenResponsesEasyInputMessageType]
content: OpenResponsesEasyInputMessageContentUnion2TypedDict
type: NotRequired[OpenResponsesEasyInputMessageTypeMessage]
class OpenResponsesEasyInputMessage(BaseModel):
role: OpenResponsesEasyInputMessageRoleUnion
content: OpenResponsesEasyInputMessageContent2
content: OpenResponsesEasyInputMessageContentUnion2
type: Optional[OpenResponsesEasyInputMessageType] = None
type: Optional[OpenResponsesEasyInputMessageTypeMessage] = None
@@ -60,9 +60,9 @@ OpenResponsesInput1TypedDict = TypeAliasType(
OpenResponsesFunctionCallOutputTypedDict,
ResponsesOutputMessageTypedDict,
OpenResponsesFunctionToolCallTypedDict,
ResponsesOutputItemReasoningTypedDict,
ResponsesOutputItemFunctionCallTypedDict,
OpenResponsesReasoningTypedDict,
ResponsesOutputItemReasoningTypedDict,
],
)
@@ -78,9 +78,9 @@ OpenResponsesInput1 = TypeAliasType(
OpenResponsesFunctionCallOutput,
ResponsesOutputMessage,
OpenResponsesFunctionToolCall,
ResponsesOutputItemReasoning,
ResponsesOutputItemFunctionCall,
OpenResponsesReasoning,
ResponsesOutputItemReasoning,
],
)
@@ -3,16 +3,24 @@
from __future__ import annotations
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
from openrouter.types import BaseModel
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import get_discriminator, validate_open_enum
from pydantic import Discriminator, Tag, model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
OpenResponsesInputMessageItemType = Literal["message",]
OpenResponsesInputMessageItemTypeMessage = Literal["message",]
OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",]
@@ -44,23 +52,88 @@ OpenResponsesInputMessageItemRoleUnion = TypeAliasType(
)
OpenResponsesInputMessageItemContentTypedDict = TypeAliasType(
"OpenResponsesInputMessageItemContentTypedDict",
OpenResponsesInputMessageItemContentType = Literal["input_image",]
OpenResponsesInputMessageItemDetail = Union[
Literal[
"auto",
"high",
"low",
],
UnrecognizedStr,
]
class OpenResponsesInputMessageItemContentInputImageTypedDict(TypedDict):
r"""Image input content item"""
type: OpenResponsesInputMessageItemContentType
detail: OpenResponsesInputMessageItemDetail
image_url: NotRequired[Nullable[str]]
class OpenResponsesInputMessageItemContentInputImage(BaseModel):
r"""Image input content item"""
type: OpenResponsesInputMessageItemContentType
detail: Annotated[
OpenResponsesInputMessageItemDetail, PlainValidator(validate_open_enum(False))
]
image_url: OptionalNullable[str] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["image_url"]
nullable_fields = ["image_url"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
OpenResponsesInputMessageItemContentUnionTypedDict = TypeAliasType(
"OpenResponsesInputMessageItemContentUnionTypedDict",
Union[
ResponseInputTextTypedDict,
ResponseInputAudioTypedDict,
ResponseInputImageTypedDict,
ResponseInputVideoTypedDict,
OpenResponsesInputMessageItemContentInputImageTypedDict,
ResponseInputFileTypedDict,
],
)
OpenResponsesInputMessageItemContent = Annotated[
OpenResponsesInputMessageItemContentUnion = Annotated[
Union[
Annotated[ResponseInputText, Tag("input_text")],
Annotated[ResponseInputImage, Tag("input_image")],
Annotated[OpenResponsesInputMessageItemContentInputImage, Tag("input_image")],
Annotated[ResponseInputFile, Tag("input_file")],
Annotated[ResponseInputAudio, Tag("input_audio")],
Annotated[ResponseInputVideo, Tag("input_video")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
@@ -68,16 +141,16 @@ OpenResponsesInputMessageItemContent = Annotated[
class OpenResponsesInputMessageItemTypedDict(TypedDict):
role: OpenResponsesInputMessageItemRoleUnionTypedDict
content: List[OpenResponsesInputMessageItemContentTypedDict]
content: List[OpenResponsesInputMessageItemContentUnionTypedDict]
id: NotRequired[str]
type: NotRequired[OpenResponsesInputMessageItemType]
type: NotRequired[OpenResponsesInputMessageItemTypeMessage]
class OpenResponsesInputMessageItem(BaseModel):
role: OpenResponsesInputMessageItemRoleUnion
content: List[OpenResponsesInputMessageItemContent]
content: List[OpenResponsesInputMessageItemContentUnion]
id: Optional[str] = None
type: Optional[OpenResponsesInputMessageItemType] = None
type: Optional[OpenResponsesInputMessageItemTypeMessage] = None
@@ -149,24 +149,27 @@ class OpenResponsesNonStreamingResponseTypedDict(TypedDict):
object: Object
created_at: float
model: str
status: OpenAIResponsesResponseStatus
completed_at: Nullable[float]
output: List[ResponsesOutputItemTypedDict]
error: Nullable[ResponsesErrorFieldTypedDict]
r"""Error information returned from the API"""
incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict]
temperature: Nullable[float]
top_p: Nullable[float]
presence_penalty: Nullable[float]
frequency_penalty: Nullable[float]
instructions: Nullable[OpenAIResponsesInputUnionTypedDict]
metadata: Nullable[Dict[str, str]]
r"""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."""
tools: List[OpenResponsesNonStreamingResponseToolUnionTypedDict]
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
parallel_tool_calls: bool
status: NotRequired[OpenAIResponsesResponseStatus]
user: NotRequired[Nullable[str]]
output_text: NotRequired[str]
prompt_cache_key: NotRequired[Nullable[str]]
safety_identifier: NotRequired[Nullable[str]]
usage: NotRequired[OpenResponsesUsageTypedDict]
usage: NotRequired[Nullable[OpenResponsesUsageTypedDict]]
r"""Token usage information for the response"""
max_tool_calls: NotRequired[Nullable[float]]
top_logprobs: NotRequired[float]
@@ -193,6 +196,12 @@ class OpenResponsesNonStreamingResponse(BaseModel):
model: str
status: Annotated[
OpenAIResponsesResponseStatus, PlainValidator(validate_open_enum(False))
]
completed_at: Nullable[float]
output: List[ResponsesOutputItem]
error: Nullable[ResponsesErrorField]
@@ -204,6 +213,10 @@ class OpenResponsesNonStreamingResponse(BaseModel):
top_p: Nullable[float]
presence_penalty: Nullable[float]
frequency_penalty: Nullable[float]
instructions: Nullable[OpenAIResponsesInputUnion]
metadata: Nullable[Dict[str, str]]
@@ -215,11 +228,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
parallel_tool_calls: bool
status: Annotated[
Optional[OpenAIResponsesResponseStatus],
PlainValidator(validate_open_enum(False)),
] = None
user: OptionalNullable[str] = UNSET
output_text: Optional[str] = None
@@ -228,7 +236,7 @@ class OpenResponsesNonStreamingResponse(BaseModel):
safety_identifier: OptionalNullable[str] = UNSET
usage: Optional[OpenResponsesUsage] = None
usage: OptionalNullable[OpenResponsesUsage] = UNSET
r"""Token usage information for the response"""
max_tool_calls: OptionalNullable[float] = UNSET
@@ -263,7 +271,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = [
"status",
"user",
"output_text",
"prompt_cache_key",
@@ -282,15 +289,19 @@ class OpenResponsesNonStreamingResponse(BaseModel):
"text",
]
nullable_fields = [
"completed_at",
"user",
"prompt_cache_key",
"safety_identifier",
"error",
"incomplete_details",
"usage",
"max_tool_calls",
"max_output_tokens",
"temperature",
"top_p",
"presence_penalty",
"frequency_penalty",
"instructions",
"metadata",
"prompt",
@@ -55,6 +55,7 @@ OpenResponsesReasoningFormat = Union[
Literal[
"unknown",
"openai-responses-v1",
"azure-openai-responses-v1",
"xai-responses-v1",
"anthropic-claude-v1",
"google-gemini-v1",
@@ -34,10 +34,16 @@ from .openresponseswebsearchtool import (
OpenResponsesWebSearchToolTypedDict,
)
from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName
from .providersort import ProviderSort
from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict
from .quantization import Quantization
from .responsesoutputmodality import ResponsesOutputModality
from .websearchengine import WebSearchEngine
from openrouter.types import (
BaseModel,
@@ -139,6 +145,16 @@ OpenResponsesRequestToolUnion = Annotated[
]
OpenResponsesRequestImageConfigTypedDict = TypeAliasType(
"OpenResponsesRequestImageConfigTypedDict", Union[str, float]
)
OpenResponsesRequestImageConfig = TypeAliasType(
"OpenResponsesRequestImageConfig", Union[str, float]
)
ServiceTier = Literal["auto",]
@@ -269,14 +285,10 @@ class OpenResponsesRequestProviderTypedDict(TypedDict):
r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed."""
max_price: NotRequired[OpenResponsesRequestMaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: NotRequired[Nullable[float]]
r"""Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[Nullable[float]]
r"""Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
min_throughput: NotRequired[Nullable[float]]
r"""**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput."""
max_latency: NotRequired[Nullable[float]]
r"""**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency."""
preferred_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]]
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]]
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
class OpenResponsesRequestProvider(BaseModel):
@@ -327,27 +339,11 @@ class OpenResponsesRequestProvider(BaseModel):
max_price: Optional[OpenResponsesRequestMaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: OptionalNullable[float] = UNSET
r"""Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_min_throughput: OptionalNullable[PreferredMinThroughput] = UNSET
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: OptionalNullable[float] = UNSET
r"""Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
min_throughput: Annotated[
OptionalNullable[float],
pydantic.Field(
deprecated="warning: ** DEPRECATED ** - Use preferred_min_throughput instead.."
),
] = UNSET
r"""**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput."""
max_latency: Annotated[
OptionalNullable[float],
pydantic.Field(
deprecated="warning: ** DEPRECATED ** - Use preferred_max_latency instead.."
),
] = UNSET
r"""**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency."""
preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -365,8 +361,6 @@ class OpenResponsesRequestProvider(BaseModel):
"max_price",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
nullable_fields = [
"allow_fallbacks",
@@ -381,8 +375,6 @@ class OpenResponsesRequestProvider(BaseModel):
"sort",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
null_default_fields = []
@@ -488,11 +480,33 @@ class OpenResponsesRequestPluginModeration(BaseModel):
id: IDModeration
IDAutoRouter = Literal["auto-router",]
class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict):
id: IDAutoRouter
enabled: NotRequired[bool]
r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
allowed_models: NotRequired[List[str]]
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
class OpenResponsesRequestPluginAutoRouter(BaseModel):
id: IDAutoRouter
enabled: Optional[bool] = None
r"""Set to false to disable the auto-router plugin for this request. Defaults to true."""
allowed_models: Optional[List[str]] = None
r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list."""
OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
"OpenResponsesRequestPluginUnionTypedDict",
Union[
OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginWebTypedDict,
],
@@ -501,6 +515,7 @@ OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
OpenResponsesRequestPluginUnion = Annotated[
Union[
Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
@@ -530,7 +545,15 @@ class OpenResponsesRequestTypedDict(TypedDict):
max_output_tokens: NotRequired[Nullable[float]]
temperature: NotRequired[Nullable[float]]
top_p: NotRequired[Nullable[float]]
top_logprobs: NotRequired[Nullable[int]]
max_tool_calls: NotRequired[Nullable[int]]
presence_penalty: NotRequired[Nullable[float]]
frequency_penalty: NotRequired[Nullable[float]]
top_k: NotRequired[float]
image_config: NotRequired[Dict[str, OpenResponsesRequestImageConfigTypedDict]]
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
modalities: NotRequired[List[ResponsesOutputModality]]
r"""Output modalities for the response. Supported values are \"text\" and \"image\"."""
prompt_cache_key: NotRequired[Nullable[str]]
previous_response_id: NotRequired[Nullable[str]]
prompt: NotRequired[Nullable[OpenAIResponsesPromptTypedDict]]
@@ -584,8 +607,28 @@ class OpenResponsesRequest(BaseModel):
top_p: OptionalNullable[float] = UNSET
top_logprobs: OptionalNullable[int] = UNSET
max_tool_calls: OptionalNullable[int] = UNSET
presence_penalty: OptionalNullable[float] = UNSET
frequency_penalty: OptionalNullable[float] = UNSET
top_k: Optional[float] = None
image_config: Optional[Dict[str, OpenResponsesRequestImageConfig]] = None
r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details."""
modalities: Optional[
List[
Annotated[
ResponsesOutputModality, PlainValidator(validate_open_enum(False))
]
]
] = None
r"""Output modalities for the response. Supported values are \"text\" and \"image\"."""
prompt_cache_key: OptionalNullable[str] = UNSET
previous_response_id: OptionalNullable[str] = UNSET
@@ -645,7 +688,13 @@ class OpenResponsesRequest(BaseModel):
"max_output_tokens",
"temperature",
"top_p",
"top_logprobs",
"max_tool_calls",
"presence_penalty",
"frequency_penalty",
"top_k",
"image_config",
"modalities",
"prompt_cache_key",
"previous_response_id",
"prompt",
@@ -669,6 +718,10 @@ class OpenResponsesRequest(BaseModel):
"max_output_tokens",
"temperature",
"top_p",
"top_logprobs",
"max_tool_calls",
"presence_penalty",
"frequency_penalty",
"prompt_cache_key",
"previous_response_id",
"prompt",
@@ -0,0 +1,71 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing_extensions import NotRequired, TypedDict
class PercentileLatencyCutoffsTypedDict(TypedDict):
r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: NotRequired[Nullable[float]]
r"""Maximum p50 latency (seconds)"""
p75: NotRequired[Nullable[float]]
r"""Maximum p75 latency (seconds)"""
p90: NotRequired[Nullable[float]]
r"""Maximum p90 latency (seconds)"""
p99: NotRequired[Nullable[float]]
r"""Maximum p99 latency (seconds)"""
class PercentileLatencyCutoffs(BaseModel):
r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: OptionalNullable[float] = UNSET
r"""Maximum p50 latency (seconds)"""
p75: OptionalNullable[float] = UNSET
r"""Maximum p75 latency (seconds)"""
p90: OptionalNullable[float] = UNSET
r"""Maximum p90 latency (seconds)"""
p99: OptionalNullable[float] = UNSET
r"""Maximum p99 latency (seconds)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
@@ -0,0 +1,34 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from typing_extensions import TypedDict
class PercentileStatsTypedDict(TypedDict):
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
p50: float
r"""Median (50th percentile)"""
p75: float
r"""75th percentile"""
p90: float
r"""90th percentile"""
p99: float
r"""99th percentile"""
class PercentileStats(BaseModel):
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
p50: float
r"""Median (50th percentile)"""
p75: float
r"""75th percentile"""
p90: float
r"""90th percentile"""
p99: float
r"""99th percentile"""
@@ -0,0 +1,71 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
from pydantic import model_serializer
from typing_extensions import NotRequired, TypedDict
class PercentileThroughputCutoffsTypedDict(TypedDict):
r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: NotRequired[Nullable[float]]
r"""Minimum p50 throughput (tokens/sec)"""
p75: NotRequired[Nullable[float]]
r"""Minimum p75 throughput (tokens/sec)"""
p90: NotRequired[Nullable[float]]
r"""Minimum p90 throughput (tokens/sec)"""
p99: NotRequired[Nullable[float]]
r"""Minimum p99 throughput (tokens/sec)"""
class PercentileThroughputCutoffs(BaseModel):
r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred."""
p50: OptionalNullable[float] = UNSET
r"""Minimum p50 throughput (tokens/sec)"""
p75: OptionalNullable[float] = UNSET
r"""Minimum p75 throughput (tokens/sec)"""
p90: OptionalNullable[float] = UNSET
r"""Minimum p90 throughput (tokens/sec)"""
p99: OptionalNullable[float] = UNSET
r"""Minimum p99 throughput (tokens/sec)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["p50", "p75", "p90", "p99"]
nullable_fields = ["p50", "p75", "p90", "p99"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
@@ -0,0 +1,21 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .percentilelatencycutoffs import (
PercentileLatencyCutoffs,
PercentileLatencyCutoffsTypedDict,
)
from typing import Any, Union
from typing_extensions import TypeAliasType
PreferredMaxLatencyTypedDict = TypeAliasType(
"PreferredMaxLatencyTypedDict", Union[PercentileLatencyCutoffsTypedDict, float, Any]
)
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
PreferredMaxLatency = TypeAliasType(
"PreferredMaxLatency", Union[PercentileLatencyCutoffs, float, Any]
)
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@@ -0,0 +1,22 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .percentilethroughputcutoffs import (
PercentileThroughputCutoffs,
PercentileThroughputCutoffsTypedDict,
)
from typing import Any, Union
from typing_extensions import TypeAliasType
PreferredMinThroughputTypedDict = TypeAliasType(
"PreferredMinThroughputTypedDict",
Union[PercentileThroughputCutoffsTypedDict, float, Any],
)
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
PreferredMinThroughput = TypeAliasType(
"PreferredMinThroughput", Union[PercentileThroughputCutoffs, float, Any]
)
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
+3 -2
View File
@@ -33,12 +33,12 @@ ProviderName = Union[
"Fireworks",
"Friendli",
"GMICloud",
"GoPomelo",
"Google",
"Google AI Studio",
"Groq",
"Hyperbolic",
"Inception",
"Inceptron",
"InferenceNet",
"Infermatic",
"Inflection",
@@ -63,13 +63,14 @@ ProviderName = Union[
"Phala",
"Relace",
"SambaNova",
"Seed",
"SiliconFlow",
"Sourceful",
"Stealth",
"StreamLake",
"Switchpoint",
"Targon",
"Together",
"Upstage",
"Venice",
"WandB",
"Xiaomi",
@@ -2,6 +2,11 @@
from __future__ import annotations
from .datacollection import DataCollection
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName
from .providersort import ProviderSort
from .quantization import Quantization
@@ -14,7 +19,6 @@ from openrouter.types import (
UnrecognizedStr,
)
from openrouter.utils import validate_open_enum
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
@@ -234,14 +238,10 @@ class ProviderPreferencesTypedDict(TypedDict):
sort: NotRequired[Nullable[ProviderPreferencesSortUnionTypedDict]]
max_price: NotRequired[ProviderPreferencesMaxPriceTypedDict]
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: NotRequired[Nullable[float]]
r"""Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[Nullable[float]]
r"""Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
min_throughput: NotRequired[Nullable[float]]
r"""**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput."""
max_latency: NotRequired[Nullable[float]]
r"""**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency."""
preferred_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]]
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]]
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
class ProviderPreferences(BaseModel):
@@ -291,27 +291,11 @@ class ProviderPreferences(BaseModel):
max_price: Optional[ProviderPreferencesMaxPrice] = None
r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion."""
preferred_min_throughput: OptionalNullable[float] = UNSET
r"""Preferred minimum throughput (in tokens per second). Endpoints below this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_min_throughput: OptionalNullable[PreferredMinThroughput] = UNSET
r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
preferred_max_latency: OptionalNullable[float] = UNSET
r"""Preferred maximum latency (in seconds). Endpoints above this threshold may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
min_throughput: Annotated[
OptionalNullable[float],
pydantic.Field(
deprecated="warning: ** DEPRECATED ** - Use preferred_min_throughput instead.."
),
] = UNSET
r"""**DEPRECATED** Use preferred_min_throughput instead. Backwards-compatible alias for preferred_min_throughput."""
max_latency: Annotated[
OptionalNullable[float],
pydantic.Field(
deprecated="warning: ** DEPRECATED ** - Use preferred_max_latency instead.."
),
] = UNSET
r"""**DEPRECATED** Use preferred_max_latency instead. Backwards-compatible alias for preferred_max_latency."""
preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET
r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
@@ -329,8 +313,6 @@ class ProviderPreferences(BaseModel):
"max_price",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
nullable_fields = [
"allow_fallbacks",
@@ -345,8 +327,6 @@ class ProviderPreferences(BaseModel):
"sort",
"preferred_min_throughput",
"preferred_max_latency",
"min_throughput",
"max_latency",
]
null_default_fields = []
@@ -3,6 +3,7 @@
from __future__ import annotations
from .endpointstatus import EndpointStatus
from .parameter import Parameter
from .percentilestats import PercentileStats, PercentileStatsTypedDict
from .providername import ProviderName
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
from openrouter.utils import validate_open_enum
@@ -111,6 +112,9 @@ class PublicEndpointTypedDict(TypedDict):
supported_parameters: List[Parameter]
uptime_last_30m: Nullable[float]
supports_implicit_caching: bool
latency_last_30m: Nullable[PercentileStatsTypedDict]
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
throughput_last_30m: Nullable[PercentileStatsTypedDict]
status: NotRequired[EndpointStatus]
@@ -145,6 +149,11 @@ class PublicEndpoint(BaseModel):
supports_implicit_caching: bool
latency_last_30m: Nullable[PercentileStats]
r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests."""
throughput_last_30m: Nullable[PercentileStats]
status: Annotated[
Optional[EndpointStatus], PlainValidator(validate_open_enum(True))
] = None
@@ -157,6 +166,8 @@ class PublicEndpoint(BaseModel):
"max_completion_tokens",
"max_prompt_tokens",
"uptime_last_30m",
"latency_last_30m",
"throughput_last_30m",
]
null_default_fields = []
@@ -0,0 +1,26 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from typing import Literal
from typing_extensions import TypedDict
ResponseInputVideoType = Literal["input_video",]
class ResponseInputVideoTypedDict(TypedDict):
r"""Video input content item"""
type: ResponseInputVideoType
video_url: str
r"""A base64 data URL or remote URL that resolves to a video file"""
class ResponseInputVideo(BaseModel):
r"""Video input content item"""
type: ResponseInputVideoType
video_url: str
r"""A base64 data URL or remote URL that resolves to a video file"""
@@ -6,17 +6,50 @@ from .openairesponsesannotation import (
OpenAIResponsesAnnotationTypedDict,
)
from openrouter.types import BaseModel
import pydantic
from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict
from typing_extensions import Annotated, NotRequired, TypedDict
ResponseOutputTextType = Literal["output_text",]
class ResponseOutputTextTopLogprobTypedDict(TypedDict):
token: str
bytes_: List[float]
logprob: float
class ResponseOutputTextTopLogprob(BaseModel):
token: str
bytes_: Annotated[List[float], pydantic.Field(alias="bytes")]
logprob: float
class LogprobTypedDict(TypedDict):
token: str
bytes_: List[float]
logprob: float
top_logprobs: List[ResponseOutputTextTopLogprobTypedDict]
class Logprob(BaseModel):
token: str
bytes_: Annotated[List[float], pydantic.Field(alias="bytes")]
logprob: float
top_logprobs: List[ResponseOutputTextTopLogprob]
class ResponseOutputTextTypedDict(TypedDict):
type: ResponseOutputTextType
text: str
annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]]
logprobs: NotRequired[List[LogprobTypedDict]]
class ResponseOutputText(BaseModel):
@@ -25,3 +58,5 @@ class ResponseOutputText(BaseModel):
text: str
annotations: Optional[List[OpenAIResponsesAnnotation]] = None
logprobs: Optional[List[Logprob]] = None
@@ -38,8 +38,8 @@ ResponsesOutputItemTypedDict = TypeAliasType(
ResponsesOutputItemFileSearchCallTypedDict,
ResponsesImageGenerationCallTypedDict,
ResponsesOutputMessageTypedDict,
ResponsesOutputItemReasoningTypedDict,
ResponsesOutputItemFunctionCallTypedDict,
ResponsesOutputItemReasoningTypedDict,
],
)
r"""An output item from the response"""
@@ -9,10 +9,14 @@ from openrouter.types import (
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import validate_open_enum
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ResponsesOutputItemReasoningType = Literal["reasoning",]
@@ -47,6 +51,20 @@ ResponsesOutputItemReasoningStatusUnion = TypeAliasType(
)
ResponsesOutputItemReasoningFormat = Union[
Literal[
"unknown",
"openai-responses-v1",
"azure-openai-responses-v1",
"xai-responses-v1",
"anthropic-claude-v1",
"google-gemini-v1",
],
UnrecognizedStr,
]
r"""The format of the reasoning content"""
class ResponsesOutputItemReasoningTypedDict(TypedDict):
r"""An output item containing reasoning"""
@@ -56,6 +74,10 @@ class ResponsesOutputItemReasoningTypedDict(TypedDict):
content: NotRequired[List[ReasoningTextContentTypedDict]]
encrypted_content: NotRequired[Nullable[str]]
status: NotRequired[ResponsesOutputItemReasoningStatusUnionTypedDict]
signature: NotRequired[Nullable[str]]
r"""A signature for the reasoning content, used for verification"""
format_: NotRequired[Nullable[ResponsesOutputItemReasoningFormat]]
r"""The format of the reasoning content"""
class ResponsesOutputItemReasoning(BaseModel):
@@ -73,10 +95,28 @@ class ResponsesOutputItemReasoning(BaseModel):
status: Optional[ResponsesOutputItemReasoningStatusUnion] = None
signature: OptionalNullable[str] = UNSET
r"""A signature for the reasoning content, used for verification"""
format_: Annotated[
Annotated[
OptionalNullable[ResponsesOutputItemReasoningFormat],
PlainValidator(validate_open_enum(False)),
],
pydantic.Field(alias="format"),
] = UNSET
r"""The format of the reasoning content"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["content", "encrypted_content", "status"]
nullable_fields = ["encrypted_content"]
optional_fields = [
"content",
"encrypted_content",
"status",
"signature",
"format",
]
nullable_fields = ["encrypted_content", "signature", "format"]
null_default_fields = []
serialized = handler(self)
@@ -0,0 +1,14 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import UnrecognizedStr
from typing import Literal, Union
ResponsesOutputModality = Union[
Literal[
"text",
"image",
],
UnrecognizedStr,
]
@@ -96,6 +96,8 @@ class GetGenerationDataTypedDict(TypedDict):
r"""External user identifier"""
api_type: Nullable[APIType]
r"""Type of API used for the generation"""
router: Nullable[str]
r"""Router used for the request (e.g., openrouter/auto)"""
class GetGenerationData(BaseModel):
@@ -197,6 +199,9 @@ class GetGenerationData(BaseModel):
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
r"""Type of API used for the generation"""
router: Nullable[str]
r"""Router used for the request (e.g., openrouter/auto)"""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = []
@@ -226,6 +231,7 @@ class GetGenerationData(BaseModel):
"native_finish_reason",
"external_user",
"api_type",
"router",
]
null_default_fields = []
+114
View File
@@ -57,7 +57,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -108,7 +119,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -168,7 +185,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -219,7 +247,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -278,7 +312,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -329,7 +374,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -383,7 +434,13 @@ class Responses(BaseSDK):
max_output_tokens=max_output_tokens,
temperature=temperature,
top_p=top_p,
top_logprobs=top_logprobs,
max_tool_calls=max_tool_calls,
presence_penalty=presence_penalty,
frequency_penalty=frequency_penalty,
top_k=top_k,
image_config=image_config,
modalities=modalities,
prompt_cache_key=prompt_cache_key,
previous_response_id=previous_response_id,
prompt=utils.get_pydantic_model(
@@ -633,7 +690,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -684,7 +752,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -744,7 +818,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -795,7 +880,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -854,7 +945,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET,
top_p: OptionalNullable[float] = UNSET,
top_logprobs: OptionalNullable[int] = UNSET,
max_tool_calls: OptionalNullable[int] = UNSET,
presence_penalty: OptionalNullable[float] = UNSET,
frequency_penalty: OptionalNullable[float] = UNSET,
top_k: Optional[float] = None,
image_config: Optional[
Union[
Dict[str, components.OpenResponsesRequestImageConfig],
Dict[str, components.OpenResponsesRequestImageConfigTypedDict],
]
] = None,
modalities: Optional[List[components.ResponsesOutputModality]] = None,
prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[
@@ -905,7 +1007,13 @@ class Responses(BaseSDK):
:param max_output_tokens:
:param temperature:
:param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k:
:param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.
:param modalities: Output modalities for the response. Supported values are \"text\" and \"image\".
:param prompt_cache_key:
:param previous_response_id:
:param prompt:
@@ -959,7 +1067,13 @@ class Responses(BaseSDK):
max_output_tokens=max_output_tokens,
temperature=temperature,
top_p=top_p,
top_logprobs=top_logprobs,
max_tool_calls=max_tool_calls,
presence_penalty=presence_penalty,
frequency_penalty=frequency_penalty,
top_k=top_k,
image_config=image_config,
modalities=modalities,
prompt_cache_key=prompt_cache_key,
previous_response_id=previous_response_id,
prompt=utils.get_pydantic_model(