Compare commits

...
2 Commits
92 changed files with 2569 additions and 511 deletions
+47 -13
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management: management:
docChecksum: a5b3a567dd4de3ab77a9f0b23d4a9f10 docChecksum: 331e8a1f7c97c6a4a6b57eaddc80fc39
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
generationVersion: 2.768.0 generationVersion: 2.768.0
releaseVersion: 0.0.17 releaseVersion: 0.0.18
configChecksum: 50ef18bf69272fc09c257e3562e1b0df configChecksum: 1f58284fadb5b2b9029e9ef747f2a7e9
repoURL: https://github.com/OpenRouterTeam/python-sdk.git repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true published: true
@@ -60,12 +60,18 @@ generatedFiles:
- docs/components/chaterrorerror.md - docs/components/chaterrorerror.md
- docs/components/chatgenerationparams.md - docs/components/chatgenerationparams.md
- docs/components/chatgenerationparamsdatacollection.md - docs/components/chatgenerationparamsdatacollection.md
- docs/components/chatgenerationparamsimageconfig.md
- docs/components/chatgenerationparamsmaxprice.md - docs/components/chatgenerationparamsmaxprice.md
- docs/components/chatgenerationparamspluginautorouter.md
- docs/components/chatgenerationparamspluginfileparser.md - docs/components/chatgenerationparamspluginfileparser.md
- docs/components/chatgenerationparamspluginmoderation.md - docs/components/chatgenerationparamspluginmoderation.md
- docs/components/chatgenerationparamspluginresponsehealing.md - docs/components/chatgenerationparamspluginresponsehealing.md
- docs/components/chatgenerationparamspluginunion.md - docs/components/chatgenerationparamspluginunion.md
- docs/components/chatgenerationparamspluginweb.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/chatgenerationparamsprovider.md
- docs/components/chatgenerationparamsresponseformatjsonobject.md - docs/components/chatgenerationparamsresponseformatjsonobject.md
- docs/components/chatgenerationparamsresponseformatpython.md - docs/components/chatgenerationparamsresponseformatpython.md
@@ -85,6 +91,7 @@ generatedFiles:
- docs/components/chatmessagecontentitemvideovideourl.md - docs/components/chatmessagecontentitemvideovideourl.md
- docs/components/chatmessagetokenlogprob.md - docs/components/chatmessagetokenlogprob.md
- docs/components/chatmessagetokenlogprobs.md - docs/components/chatmessagetokenlogprobs.md
- docs/components/chatmessagetokenlogprobtoplogprob.md
- docs/components/chatmessagetoolcall.md - docs/components/chatmessagetoolcall.md
- docs/components/chatmessagetoolcallfunction.md - docs/components/chatmessagetoolcallfunction.md
- docs/components/chatresponse.md - docs/components/chatresponse.md
@@ -126,6 +133,7 @@ generatedFiles:
- docs/components/filepath.md - docs/components/filepath.md
- docs/components/filepathtype.md - docs/components/filepathtype.md
- docs/components/forbiddenresponseerrordata.md - docs/components/forbiddenresponseerrordata.md
- docs/components/idautorouter.md
- docs/components/idfileparser.md - docs/components/idfileparser.md
- docs/components/idmoderation.md - docs/components/idmoderation.md
- docs/components/idresponsehealing.md - docs/components/idresponsehealing.md
@@ -138,9 +146,11 @@ generatedFiles:
- docs/components/internalserverresponseerrordata.md - docs/components/internalserverresponseerrordata.md
- docs/components/jsonschemaconfig.md - docs/components/jsonschemaconfig.md
- docs/components/listendpointsresponse.md - docs/components/listendpointsresponse.md
- docs/components/logprob.md
- docs/components/message.md - docs/components/message.md
- docs/components/messagecontent.md - docs/components/messagecontent.md
- docs/components/messagedeveloper.md - docs/components/messagedeveloper.md
- docs/components/modality.md
- docs/components/model.md - docs/components/model.md
- docs/components/modelarchitecture.md - docs/components/modelarchitecture.md
- docs/components/modelarchitectureinstructtype.md - docs/components/modelarchitectureinstructtype.md
@@ -195,14 +205,17 @@ generatedFiles:
- docs/components/openairesponsestoolchoiceunion.md - docs/components/openairesponsestoolchoiceunion.md
- docs/components/openairesponsestruncation.md - docs/components/openairesponsestruncation.md
- docs/components/openresponseseasyinputmessage.md - docs/components/openresponseseasyinputmessage.md
- docs/components/openresponseseasyinputmessagecontent1.md - docs/components/openresponseseasyinputmessagecontentinputimage.md
- docs/components/openresponseseasyinputmessagecontent2.md - docs/components/openresponseseasyinputmessagecontenttype.md
- docs/components/openresponseseasyinputmessagecontentunion1.md
- docs/components/openresponseseasyinputmessagecontentunion2.md
- docs/components/openresponseseasyinputmessagedetail.md
- docs/components/openresponseseasyinputmessageroleassistant.md - docs/components/openresponseseasyinputmessageroleassistant.md
- docs/components/openresponseseasyinputmessageroledeveloper.md - docs/components/openresponseseasyinputmessageroledeveloper.md
- docs/components/openresponseseasyinputmessagerolesystem.md - docs/components/openresponseseasyinputmessagerolesystem.md
- docs/components/openresponseseasyinputmessageroleunion.md - docs/components/openresponseseasyinputmessageroleunion.md
- docs/components/openresponseseasyinputmessageroleuser.md - docs/components/openresponseseasyinputmessageroleuser.md
- docs/components/openresponseseasyinputmessagetype.md - docs/components/openresponseseasyinputmessagetypemessage.md
- docs/components/openresponseserrorevent.md - docs/components/openresponseserrorevent.md
- docs/components/openresponseserroreventtype.md - docs/components/openresponseserroreventtype.md
- docs/components/openresponsesfunctioncalloutput.md - docs/components/openresponsesfunctioncalloutput.md
@@ -220,12 +233,15 @@ generatedFiles:
- docs/components/openresponsesinput.md - docs/components/openresponsesinput.md
- docs/components/openresponsesinput1.md - docs/components/openresponsesinput1.md
- docs/components/openresponsesinputmessageitem.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/openresponsesinputmessageitemroledeveloper.md
- docs/components/openresponsesinputmessageitemrolesystem.md - docs/components/openresponsesinputmessageitemrolesystem.md
- docs/components/openresponsesinputmessageitemroleunion.md - docs/components/openresponsesinputmessageitemroleunion.md
- docs/components/openresponsesinputmessageitemroleuser.md - docs/components/openresponsesinputmessageitemroleuser.md
- docs/components/openresponsesinputmessageitemtype.md - docs/components/openresponsesinputmessageitemtypemessage.md
- docs/components/openresponseslogprobs.md - docs/components/openresponseslogprobs.md
- docs/components/openresponsesnonstreamingresponse.md - docs/components/openresponsesnonstreamingresponse.md
- docs/components/openresponsesnonstreamingresponsetoolfunction.md - docs/components/openresponsesnonstreamingresponsetoolfunction.md
@@ -251,9 +267,11 @@ generatedFiles:
- docs/components/openresponsesreasoningtype.md - docs/components/openresponsesreasoningtype.md
- docs/components/openresponsesrequest.md - docs/components/openresponsesrequest.md
- docs/components/openresponsesrequestignore.md - docs/components/openresponsesrequestignore.md
- docs/components/openresponsesrequestimageconfig.md
- docs/components/openresponsesrequestmaxprice.md - docs/components/openresponsesrequestmaxprice.md
- docs/components/openresponsesrequestonly.md - docs/components/openresponsesrequestonly.md
- docs/components/openresponsesrequestorder.md - docs/components/openresponsesrequestorder.md
- docs/components/openresponsesrequestpluginautorouter.md
- docs/components/openresponsesrequestpluginfileparser.md - docs/components/openresponsesrequestpluginfileparser.md
- docs/components/openresponsesrequestpluginmoderation.md - docs/components/openresponsesrequestpluginmoderation.md
- docs/components/openresponsesrequestpluginresponsehealing.md - docs/components/openresponsesrequestpluginresponsehealing.md
@@ -318,7 +336,12 @@ generatedFiles:
- docs/components/pdfengine.md - docs/components/pdfengine.md
- docs/components/pdfparserengine.md - docs/components/pdfparserengine.md
- docs/components/pdfparseroptions.md - docs/components/pdfparseroptions.md
- docs/components/percentilelatencycutoffs.md
- docs/components/percentilestats.md
- docs/components/percentilethroughputcutoffs.md
- docs/components/perrequestlimits.md - docs/components/perrequestlimits.md
- docs/components/preferredmaxlatency.md
- docs/components/preferredminthroughput.md
- docs/components/pricing.md - docs/components/pricing.md
- docs/components/prompt.md - docs/components/prompt.md
- docs/components/prompttokensdetails.md - docs/components/prompttokensdetails.md
@@ -365,7 +388,10 @@ generatedFiles:
- docs/components/responseinputimagetype.md - docs/components/responseinputimagetype.md
- docs/components/responseinputtext.md - docs/components/responseinputtext.md
- docs/components/responseinputtexttype.md - docs/components/responseinputtexttype.md
- docs/components/responseinputvideo.md
- docs/components/responseinputvideotype.md
- docs/components/responseoutputtext.md - docs/components/responseoutputtext.md
- docs/components/responseoutputtexttoplogprob.md
- docs/components/responseoutputtexttype.md - docs/components/responseoutputtexttype.md
- docs/components/responseserrorfield.md - docs/components/responseserrorfield.md
- docs/components/responsesformatjsonobject.md - docs/components/responsesformatjsonobject.md
@@ -386,6 +412,7 @@ generatedFiles:
- docs/components/responsesoutputitemfunctioncallstatusunion.md - docs/components/responsesoutputitemfunctioncallstatusunion.md
- docs/components/responsesoutputitemfunctioncalltype.md - docs/components/responsesoutputitemfunctioncalltype.md
- docs/components/responsesoutputitemreasoning.md - docs/components/responsesoutputitemreasoning.md
- docs/components/responsesoutputitemreasoningformat.md
- docs/components/responsesoutputitemreasoningstatuscompleted.md - docs/components/responsesoutputitemreasoningstatuscompleted.md
- docs/components/responsesoutputitemreasoningstatusincomplete.md - docs/components/responsesoutputitemreasoningstatusincomplete.md
- docs/components/responsesoutputitemreasoningstatusinprogress.md - docs/components/responsesoutputitemreasoningstatusinprogress.md
@@ -399,6 +426,7 @@ generatedFiles:
- docs/components/responsesoutputmessagestatusinprogress.md - docs/components/responsesoutputmessagestatusinprogress.md
- docs/components/responsesoutputmessagestatusunion.md - docs/components/responsesoutputmessagestatusunion.md
- docs/components/responsesoutputmessagetype.md - docs/components/responsesoutputmessagetype.md
- docs/components/responsesoutputmodality.md
- docs/components/responsessearchcontextsize.md - docs/components/responsessearchcontextsize.md
- docs/components/responseswebsearchcalloutput.md - docs/components/responseswebsearchcalloutput.md
- docs/components/responseswebsearchcalloutputtype.md - docs/components/responseswebsearchcalloutputtype.md
@@ -428,7 +456,6 @@ generatedFiles:
- docs/components/toolresponsemessage.md - docs/components/toolresponsemessage.md
- docs/components/toolresponsemessagecontent.md - docs/components/toolresponsemessagecontent.md
- docs/components/toomanyrequestsresponseerrordata.md - docs/components/toomanyrequestsresponseerrordata.md
- docs/components/toplogprob.md
- docs/components/topproviderinfo.md - docs/components/topproviderinfo.md
- docs/components/truncation.md - docs/components/truncation.md
- docs/components/ttl.md - docs/components/ttl.md
@@ -684,7 +711,12 @@ generatedFiles:
- src/openrouter/components/paymentrequiredresponseerrordata.py - src/openrouter/components/paymentrequiredresponseerrordata.py
- src/openrouter/components/pdfparserengine.py - src/openrouter/components/pdfparserengine.py
- src/openrouter/components/pdfparseroptions.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/perrequestlimits.py
- src/openrouter/components/preferredmaxlatency.py
- src/openrouter/components/preferredminthroughput.py
- src/openrouter/components/providername.py - src/openrouter/components/providername.py
- src/openrouter/components/provideroverloadedresponseerrordata.py - src/openrouter/components/provideroverloadedresponseerrordata.py
- src/openrouter/components/providerpreferences.py - src/openrouter/components/providerpreferences.py
@@ -705,6 +737,7 @@ generatedFiles:
- src/openrouter/components/responseinputfile.py - src/openrouter/components/responseinputfile.py
- src/openrouter/components/responseinputimage.py - src/openrouter/components/responseinputimage.py
- src/openrouter/components/responseinputtext.py - src/openrouter/components/responseinputtext.py
- src/openrouter/components/responseinputvideo.py
- src/openrouter/components/responseoutputtext.py - src/openrouter/components/responseoutputtext.py
- src/openrouter/components/responseserrorfield.py - src/openrouter/components/responseserrorfield.py
- src/openrouter/components/responsesformatjsonobject.py - src/openrouter/components/responsesformatjsonobject.py
@@ -716,6 +749,7 @@ generatedFiles:
- src/openrouter/components/responsesoutputitemfunctioncall.py - src/openrouter/components/responsesoutputitemfunctioncall.py
- src/openrouter/components/responsesoutputitemreasoning.py - src/openrouter/components/responsesoutputitemreasoning.py
- src/openrouter/components/responsesoutputmessage.py - src/openrouter/components/responsesoutputmessage.py
- src/openrouter/components/responsesoutputmodality.py
- src/openrouter/components/responsessearchcontextsize.py - src/openrouter/components/responsessearchcontextsize.py
- src/openrouter/components/responseswebsearchcalloutput.py - src/openrouter/components/responseswebsearchcalloutput.py
- src/openrouter/components/responseswebsearchuserlocation.py - src/openrouter/components/responseswebsearchuserlocation.py
@@ -819,7 +853,7 @@ examples:
application/json: {"store": false, "service_tier": "auto", "stream": false} application/json: {"store": false, "service_tier": "auto", "stream": false}
responses: responses:
"200": "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": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401": "401":
@@ -932,7 +966,7 @@ examples:
id: "<id>" id: "<id>"
responses: responses:
"200": "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": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"402": "402":
@@ -982,7 +1016,7 @@ examples:
slug: "<value>" slug: "<value>"
responses: responses:
"200": "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": "404":
application/json: {"error": {"code": 404, "message": "Resource not found"}} application/json: {"error": {"code": 404, "message": "Resource not found"}}
"500": "500":
@@ -991,7 +1025,7 @@ examples:
speakeasy-default-list-endpoints-zdr: speakeasy-default-list-endpoints-zdr:
responses: responses:
"200": "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": "500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}} application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
getParameters: getParameters:
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.0.17 version: 0.0.18
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+386 -81
View File
@@ -108,6 +108,41 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/OpenAIResponsesAnnotation' $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: required:
- type - type
- text - text
@@ -268,7 +303,24 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/OutputItemReasoning' - $ref: '#/components/schemas/OutputItemReasoning'
- type: object - 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: example:
id: reasoning-123 id: reasoning-123
type: reasoning type: reasoning
@@ -279,6 +331,8 @@ components:
content: content:
- type: reasoning_text - type: reasoning_text
text: First, we analyze the problem... text: First, we analyze the problem...
signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format: anthropic-claude-v1
description: An output item containing reasoning description: An output item containing reasoning
OutputItemFunctionCall: OutputItemFunctionCall:
type: object type: object
@@ -538,6 +592,7 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/OpenAIResponsesUsage' - $ref: '#/components/schemas/OpenAIResponsesUsage'
- type: object - type: object
nullable: true
properties: properties:
cost: cost:
type: number type: number
@@ -1189,6 +1244,9 @@ components:
type: string type: string
status: status:
$ref: '#/components/schemas/OpenAIResponsesResponseStatus' $ref: '#/components/schemas/OpenAIResponsesResponseStatus'
completed_at:
type: number
nullable: true
output: output:
type: array type: array
items: items:
@@ -1239,6 +1297,12 @@ components:
top_p: top_p:
type: number type: number
nullable: true nullable: true
presence_penalty:
type: number
nullable: true
frequency_penalty:
type: number
nullable: true
instructions: instructions:
$ref: '#/components/schemas/OpenAIResponsesInput' $ref: '#/components/schemas/OpenAIResponsesInput'
metadata: metadata:
@@ -1300,11 +1364,15 @@ components:
- object - object
- created_at - created_at
- model - model
- status
- completed_at
- output - output
- error - error
- incomplete_details - incomplete_details
- temperature - temperature
- top_p - top_p
- presence_penalty
- frequency_penalty
- instructions - instructions
- metadata - metadata
- tools - tools
@@ -3224,6 +3292,7 @@ components:
enum: enum:
- unknown - unknown
- openai-responses-v1 - 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
@@ -3234,6 +3303,23 @@ components:
- type: summary_text - type: summary_text
text: Step by step analysis text: Step by step analysis
description: Reasoning output item with signature and format extensions 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: OpenResponsesEasyInputMessage:
type: object type: object
properties: properties:
@@ -3261,16 +3347,18 @@ components:
items: items:
oneOf: oneOf:
- $ref: '#/components/schemas/ResponseInputText' - $ref: '#/components/schemas/ResponseInputText'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage' - $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/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputAudio'
discriminator: - $ref: '#/components/schemas/ResponseInputVideo'
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- type: string - type: string
required: required:
- role - role
@@ -3300,16 +3388,18 @@ components:
items: items:
oneOf: oneOf:
- $ref: '#/components/schemas/ResponseInputText' - $ref: '#/components/schemas/ResponseInputText'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage' - $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/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputAudio'
discriminator: - $ref: '#/components/schemas/ResponseInputVideo'
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
required: required:
- role - role
- content - content
@@ -3418,6 +3508,11 @@ components:
example: example:
summary: auto summary: auto
enabled: true enabled: true
ResponsesOutputModality:
type: string
enum:
- text
- image
OpenAIResponsesIncludable: OpenAIResponsesIncludable:
type: string type: string
enum: enum:
@@ -3470,12 +3565,12 @@ components:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
- Hyperbolic - Hyperbolic
- Inception - Inception
- Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Inflection - Inflection
@@ -3500,13 +3595,14 @@ components:
- Phala - Phala
- Relace - Relace
- SambaNova - SambaNova
- Seed
- SiliconFlow - SiliconFlow
- Sourceful - Sourceful
- Stealth - Stealth
- StreamLake - StreamLake
- Switchpoint - Switchpoint
- Targon
- Together - Together
- Upstage
- Venice - Venice
- WandB - WandB
- Xiaomi - Xiaomi
@@ -3551,6 +3647,74 @@ components:
type: string type: string
description: A value in string format that is a large number description: A value in string format that is a large number
example: 1000 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: WebSearchEngine:
type: string type: string
enum: enum:
@@ -3637,8 +3801,45 @@ components:
type: number type: number
nullable: true nullable: true
minimum: 0 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: top_k:
type: number 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: prompt_cache_key:
type: string type: string
nullable: true 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, The object specifying the maximum price you want to pay for this request. USD price per million tokens,
for prompt and completion. for prompt and completion.
preferred_min_throughput: preferred_min_throughput:
type: number $ref: '#/components/schemas/PreferredMinThroughput'
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
preferred_max_latency: preferred_max_latency:
type: number $ref: '#/components/schemas/PreferredMaxLatency'
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.
additionalProperties: false additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference. description: When multiple model providers are available, optionally indicate your routing preference.
plugins: plugins:
type: array type: array
items: items:
oneOf: 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 - type: object
properties: properties:
id: 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 The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
prompt and completion. prompt and completion.
preferred_min_throughput: preferred_min_throughput:
type: number $ref: '#/components/schemas/PreferredMinThroughput'
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
preferred_max_latency: preferred_max_latency:
type: number $ref: '#/components/schemas/PreferredMaxLatency'
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.
description: Provider routing preferences for the request. description: Provider routing preferences for the request.
PublicPricing: PublicPricing:
type: object type: object
@@ -4595,6 +4763,34 @@ components:
- -5 - -5
- -10 - -10
example: 0 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: PublicEndpoint:
type: object type: object
properties: properties:
@@ -4662,6 +4858,15 @@ components:
nullable: true nullable: true
supports_implicit_caching: supports_implicit_caching:
type: boolean 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: required:
- name - name
- model_name - model_name
@@ -4675,6 +4880,8 @@ components:
- supported_parameters - supported_parameters
- uptime_last_30m - uptime_last_30m
- supports_implicit_caching - supports_implicit_caching
- latency_last_30m
- throughput_last_30m
description: Information about a specific model endpoint description: Information about a specific model endpoint
example: example:
name: 'OpenAI: GPT-4' name: 'OpenAI: GPT-4'
@@ -4697,6 +4904,16 @@ components:
status: 0 status: 0
uptime_last_30m: 99.5 uptime_last_30m: 99.5
supports_implicit_caching: true 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: ListEndpointsResponse:
type: object type: object
properties: properties:
@@ -4800,6 +5017,16 @@ components:
status: default status: default
uptime_last_30m: 99.5 uptime_last_30m: 99.5
supports_implicit_caching: true 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: __schema0:
type: array type: array
items: items:
@@ -4832,12 +5059,12 @@ components:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
- Hyperbolic - Hyperbolic
- Inception - Inception
- Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Inflection - Inflection
@@ -4862,13 +5089,14 @@ components:
- Phala - Phala
- Relace - Relace
- SambaNova - SambaNova
- Seed
- SiliconFlow - SiliconFlow
- Sourceful - Sourceful
- Stealth - Stealth
- StreamLake - StreamLake
- Switchpoint - Switchpoint
- Targon
- Together - Together
- Upstage
- Venice - Venice
- WandB - WandB
- Xiaomi - Xiaomi
@@ -4951,6 +5179,7 @@ components:
enum: enum:
- unknown - unknown
- openai-responses-v1 - 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
@@ -5174,6 +5403,8 @@ components:
properties: properties:
cached_tokens: cached_tokens:
type: number type: number
cache_write_tokens:
type: number
audio_tokens: audio_tokens:
type: number type: number
video_tokens: video_tokens:
@@ -5521,21 +5752,61 @@ components:
request: request:
$ref: '#/components/schemas/__schema1' $ref: '#/components/schemas/__schema1'
preferred_min_throughput: 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:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - 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: 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:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
min_throughput: p75:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
max_latency: p90:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false additionalProperties: false
- type: 'null' - type: 'null'
plugins: plugins:
@@ -5543,6 +5814,19 @@ components:
type: array type: array
items: items:
oneOf: oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object - type: object
properties: properties:
id: id:
@@ -5760,6 +6044,21 @@ components:
properties: properties:
echo_upstream_body: echo_upstream_body:
type: boolean 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: required:
- messages - messages
ProviderSortUnion: ProviderSortUnion:
@@ -6987,6 +7286,11 @@ paths:
- completions - completions
- embeddings - embeddings
description: Type of API used for the generation 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: required:
- id - id
- upstream_id - upstream_id
@@ -7020,6 +7324,7 @@ paths:
- native_finish_reason - native_finish_reason
- external_user - external_user
- api_type - api_type
- router
description: Generation data description: Generation data
required: required:
- data - data
+371 -71
View File
@@ -109,6 +109,41 @@ components:
type: array type: array
items: items:
$ref: '#/components/schemas/OpenAIResponsesAnnotation' $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: required:
- type - type
- text - text
@@ -269,7 +304,25 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/OutputItemReasoning' - $ref: '#/components/schemas/OutputItemReasoning'
- type: object - 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: example:
id: reasoning-123 id: reasoning-123
type: reasoning type: reasoning
@@ -280,6 +333,8 @@ components:
content: content:
- type: reasoning_text - type: reasoning_text
text: First, we analyze the problem... text: First, we analyze the problem...
signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
format: anthropic-claude-v1
description: An output item containing reasoning description: An output item containing reasoning
OutputItemFunctionCall: OutputItemFunctionCall:
type: object type: object
@@ -543,6 +598,7 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/OpenAIResponsesUsage' - $ref: '#/components/schemas/OpenAIResponsesUsage'
- type: object - type: object
nullable: true
properties: properties:
cost: cost:
type: number type: number
@@ -1203,6 +1259,9 @@ components:
type: string type: string
status: status:
$ref: '#/components/schemas/OpenAIResponsesResponseStatus' $ref: '#/components/schemas/OpenAIResponsesResponseStatus'
completed_at:
type: number
nullable: true
output: output:
type: array type: array
items: items:
@@ -1253,6 +1312,12 @@ components:
top_p: top_p:
type: number type: number
nullable: true nullable: true
presence_penalty:
type: number
nullable: true
frequency_penalty:
type: number
nullable: true
instructions: instructions:
$ref: '#/components/schemas/OpenAIResponsesInput' $ref: '#/components/schemas/OpenAIResponsesInput'
metadata: metadata:
@@ -1315,11 +1380,15 @@ components:
- object - object
- created_at - created_at
- model - model
- status
- completed_at
- output - output
- error - error
- incomplete_details - incomplete_details
- temperature - temperature
- top_p - top_p
- presence_penalty
- frequency_penalty
- instructions - instructions
- metadata - metadata
- tools - tools
@@ -3239,6 +3308,7 @@ components:
enum: enum:
- unknown - unknown
- openai-responses-v1 - 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
@@ -3250,6 +3320,23 @@ components:
- type: summary_text - type: summary_text
text: Step by step analysis text: Step by step analysis
description: Reasoning output item with signature and format extensions 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: OpenResponsesEasyInputMessage:
type: object type: object
properties: properties:
@@ -3277,16 +3364,18 @@ components:
items: items:
oneOf: oneOf:
- $ref: '#/components/schemas/ResponseInputText' - $ref: '#/components/schemas/ResponseInputText'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage' - $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/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputAudio'
discriminator: - $ref: '#/components/schemas/ResponseInputVideo'
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
- type: string - type: string
required: required:
- role - role
@@ -3316,16 +3405,18 @@ components:
items: items:
oneOf: oneOf:
- $ref: '#/components/schemas/ResponseInputText' - $ref: '#/components/schemas/ResponseInputText'
- allOf:
- $ref: '#/components/schemas/ResponseInputImage' - $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/ResponseInputFile'
- $ref: '#/components/schemas/ResponseInputAudio' - $ref: '#/components/schemas/ResponseInputAudio'
discriminator: - $ref: '#/components/schemas/ResponseInputVideo'
propertyName: type
mapping:
input_text: '#/components/schemas/ResponseInputText'
input_image: '#/components/schemas/ResponseInputImage'
input_file: '#/components/schemas/ResponseInputFile'
input_audio: '#/components/schemas/ResponseInputAudio'
required: required:
- role - role
- content - content
@@ -3434,6 +3525,12 @@ components:
example: example:
summary: auto summary: auto
enabled: true enabled: true
ResponsesOutputModality:
type: string
enum:
- text
- image
x-speakeasy-unknown-values: allow
OpenAIResponsesIncludable: OpenAIResponsesIncludable:
type: string type: string
enum: enum:
@@ -3487,12 +3584,12 @@ components:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
- Hyperbolic - Hyperbolic
- Inception - Inception
- Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Inflection - Inflection
@@ -3517,13 +3614,14 @@ components:
- Phala - Phala
- Relace - Relace
- SambaNova - SambaNova
- Seed
- SiliconFlow - SiliconFlow
- Sourceful - Sourceful
- Stealth - Stealth
- StreamLake - StreamLake
- Switchpoint - Switchpoint
- Targon
- Together - Together
- Upstage
- Venice - Venice
- WandB - WandB
- Xiaomi - Xiaomi
@@ -3572,6 +3670,68 @@ components:
type: string type: string
description: A value in string format that is a large number description: A value in string format that is a large number
example: 1000 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: WebSearchEngine:
type: string type: string
enum: enum:
@@ -3661,8 +3821,44 @@ components:
type: number type: number
nullable: true nullable: true
minimum: 0 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: top_k:
type: number 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: prompt_cache_key:
type: string type: string
nullable: true nullable: true
@@ -3788,38 +3984,36 @@ components:
description: >- description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. 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: preferred_min_throughput:
type: number $ref: '#/components/schemas/PreferredMinThroughput'
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
preferred_max_latency: preferred_max_latency:
type: number $ref: '#/components/schemas/PreferredMaxLatency'
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.
additionalProperties: false additionalProperties: false
description: When multiple model providers are available, optionally indicate your routing preference. description: When multiple model providers are available, optionally indicate your routing preference.
plugins: plugins:
type: array type: array
items: items:
oneOf: 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 - type: object
properties: properties:
id: id:
@@ -4129,32 +4323,9 @@ components:
description: >- description: >-
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. 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: preferred_min_throughput:
type: number $ref: '#/components/schemas/PreferredMinThroughput'
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
preferred_max_latency: preferred_max_latency:
type: number $ref: '#/components/schemas/PreferredMaxLatency'
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.
description: Provider routing preferences for the request. description: Provider routing preferences for the request.
PublicPricing: PublicPricing:
type: object type: object
@@ -4594,6 +4765,33 @@ components:
- -10 - -10
example: 0 example: 0
x-speakeasy-unknown-values: allow 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: PublicEndpoint:
type: object type: object
properties: properties:
@@ -4661,6 +4859,13 @@ components:
nullable: true nullable: true
supports_implicit_caching: supports_implicit_caching:
type: boolean 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: required:
- name - name
- model_name - model_name
@@ -4674,6 +4879,8 @@ components:
- supported_parameters - supported_parameters
- uptime_last_30m - uptime_last_30m
- supports_implicit_caching - supports_implicit_caching
- latency_last_30m
- throughput_last_30m
description: Information about a specific model endpoint description: Information about a specific model endpoint
example: example:
name: 'OpenAI: GPT-4' name: 'OpenAI: GPT-4'
@@ -4696,6 +4903,16 @@ components:
status: 0 status: 0
uptime_last_30m: 99.5 uptime_last_30m: 99.5
supports_implicit_caching: true 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: ListEndpointsResponse:
type: object type: object
properties: properties:
@@ -4799,6 +5016,16 @@ components:
status: default status: default
uptime_last_30m: 99.5 uptime_last_30m: 99.5
supports_implicit_caching: true 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: __schema0:
type: array type: array
items: items:
@@ -4831,12 +5058,12 @@ components:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
- Hyperbolic - Hyperbolic
- Inception - Inception
- Inceptron
- InferenceNet - InferenceNet
- Infermatic - Infermatic
- Inflection - Inflection
@@ -4861,13 +5088,14 @@ components:
- Phala - Phala
- Relace - Relace
- SambaNova - SambaNova
- Seed
- SiliconFlow - SiliconFlow
- Sourceful - Sourceful
- Stealth - Stealth
- StreamLake - StreamLake
- Switchpoint - Switchpoint
- Targon
- Together - Together
- Upstage
- Venice - Venice
- WandB - WandB
- Xiaomi - Xiaomi
@@ -4951,6 +5179,7 @@ components:
enum: enum:
- unknown - unknown
- openai-responses-v1 - 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
@@ -5176,6 +5405,8 @@ components:
properties: properties:
cached_tokens: cached_tokens:
type: number type: number
cache_write_tokens:
type: number
audio_tokens: audio_tokens:
type: number type: number
video_tokens: video_tokens:
@@ -5518,21 +5749,55 @@ components:
request: request:
$ref: '#/components/schemas/__schema1' $ref: '#/components/schemas/__schema1'
preferred_min_throughput: 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:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - 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: 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:
- anyOf:
- type: number
- type: object
properties:
p50:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
min_throughput: p75:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
max_latency: p90:
anyOf: anyOf:
- type: number - type: number
- type: 'null' - type: 'null'
p99:
anyOf:
- type: number
- type: 'null'
- type: 'null'
additionalProperties: false additionalProperties: false
- type: 'null' - type: 'null'
plugins: plugins:
@@ -5540,6 +5805,19 @@ components:
type: array type: array
items: items:
oneOf: oneOf:
- type: object
properties:
id:
type: string
const: auto-router
enabled:
type: boolean
allowed_models:
type: array
items:
type: string
required:
- id
- type: object - type: object
properties: properties:
id: id:
@@ -5759,6 +6037,22 @@ components:
properties: properties:
echo_upstream_body: echo_upstream_body:
type: boolean 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: required:
- messages - messages
ProviderSortUnion: ProviderSortUnion:
@@ -6989,6 +7283,11 @@ paths:
- embeddings - embeddings
description: Type of API used for the generation description: Type of API used for the generation
x-speakeasy-unknown-values: allow x-speakeasy-unknown-values: allow
router:
type: string
nullable: true
description: Router used for the request (e.g., openrouter/auto)
example: openrouter/auto
required: required:
- id - id
- upstream_id - upstream_id
@@ -7022,6 +7321,7 @@ paths:
- native_finish_reason - native_finish_reason
- external_user - external_user
- api_type - api_type
- router
description: Generation data description: Generation data
required: required:
- data - data
+5 -5
View File
@@ -8,8 +8,8 @@ sources:
- latest - latest
OpenRouter API: OpenRouter API:
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:92f6f1568ba089ae8e52bd55d859a97e446ae232c4c9ca9302ea64705313c7a0 sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
tags: tags:
- latest - latest
- 1.0.0 - 1.0.0
@@ -17,10 +17,10 @@ targets:
open-router: open-router:
source: OpenRouter API source: OpenRouter API
sourceNamespace: open-router-chat-completions-api sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:92f6f1568ba089ae8e52bd55d859a97e446ae232c4c9ca9302ea64705313c7a0 sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7
sourceBlobDigest: sha256:6bbf6ab7123261f7e0604f1c640e32b5fc8fb6bb503b1bc8b12d0d78ed19fefc sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:8340c172a77ca9ffeeea6ca5dce0d69a084a3ba0a4e2e41d098759f546d80da4 codeSamplesRevisionDigest: sha256:95a78f7dc072063abfd68a880ad1054c27a9a9077449cbf667d07de13a15112a
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
+2
View File
@@ -32,3 +32,5 @@
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :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 | | `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 ## Supported Types
### `components.ChatGenerationParamsPluginAutoRouter`
```python
value: components.ChatGenerationParamsPluginAutoRouter = /* values here */
```
### `components.ChatGenerationParamsPluginModeration` ### `components.ChatGenerationParamsPluginModeration`
```python ```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 */
```
@@ -4,7 +4,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | 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/> | | `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. | | `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. | | `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. |
@@ -16,7 +16,5 @@
| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | `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. | | `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. | | `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_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[float]* | :heavy_minus_sign: | N/A | | `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. |
| `min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+2 -2
View File
@@ -4,8 +4,8 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `token` | *str* | :heavy_check_mark: | N/A | | `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :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 |
| `top_logprobs` | List[[components.TopLogprob](../components/toplogprob.md)] | :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 |
@@ -4,7 +4,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `type` | [Optional[components.OpenResponsesEasyInputMessageType]](../components/openresponseseasyinputmessagetype.md) | :heavy_minus_sign: | N/A | | `type` | [Optional[components.OpenResponsesEasyInputMessageTypeMessage]](../components/openresponseseasyinputmessagetypemessage.md) | :heavy_minus_sign: | N/A |
| `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A | | `role` | [components.OpenResponsesEasyInputMessageRoleUnion](../components/openresponseseasyinputmessageroleunion.md) | :heavy_check_mark: | N/A |
| `content` | [components.OpenResponsesEasyInputMessageContent2](../components/openresponseseasyinputmessagecontent2.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 ## Supported Types
@@ -9,10 +9,10 @@
value: components.ResponseInputText = /* values here */ value: components.ResponseInputText = /* values here */
``` ```
### `components.ResponseInputImage` ### `components.OpenResponsesEasyInputMessageContentInputImage`
```python ```python
value: components.ResponseInputImage = /* values here */ value: components.OpenResponsesEasyInputMessageContentInputImage = /* values here */
``` ```
### `components.ResponseInputFile` ### `components.ResponseInputFile`
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
value: components.ResponseInputAudio = /* 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 ## Values
@@ -4,8 +4,8 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `type` | [Optional[components.OpenResponsesInputMessageItemType]](../components/openresponsesinputmessageitemtype.md) | :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 | | `role` | [components.OpenResponsesInputMessageItemRoleUnion](../components/openresponsesinputmessageitemroleunion.md) | :heavy_check_mark: | N/A |
| `content` | List[[components.OpenResponsesInputMessageItemContent](../components/openresponsesinputmessageitemcontent.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 ## Supported Types
@@ -9,10 +9,10 @@
value: components.ResponseInputText = /* values here */ value: components.ResponseInputText = /* values here */
``` ```
### `components.ResponseInputImage` ### `components.OpenResponsesInputMessageItemContentInputImage`
```python ```python
value: components.ResponseInputImage = /* values here */ value: components.OpenResponsesInputMessageItemContentInputImage = /* values here */
``` ```
### `components.ResponseInputFile` ### `components.ResponseInputFile`
@@ -27,3 +27,9 @@ value: components.ResponseInputFile = /* values here */
value: components.ResponseInputAudio = /* 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 ## Values
@@ -11,7 +11,8 @@ Complete non-streaming response from the Responses API
| `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | | | `object` | [components.Object](../components/object.md) | :heavy_check_mark: | N/A | |
| `created_at` | *float* | :heavy_check_mark: | N/A | | | `created_at` | *float* | :heavy_check_mark: | N/A | |
| `model` | *str* | :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 | | | `output` | List[[components.ResponsesOutputItem](../components/responsesoutputitem.md)] | :heavy_check_mark: | N/A | |
| `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `user` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `output_text` | *Optional[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 | | | `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/>} | | `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 | | | `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 | | | `max_tool_calls` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_logprobs` | *Optional[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 | | | `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | | | `temperature` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `top_p` | *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 | | | `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/>} | | `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 | | | `tools` | List[[components.OpenResponsesNonStreamingResponseToolUnion](../components/openresponsesnonstreamingresponsetoolunion.md)] | :heavy_check_mark: | N/A | |
@@ -4,9 +4,10 @@
## Values ## Values
| Name | Value | | Name | Value |
| --------------------- | --------------------- | | --------------------------- | --------------------------- |
| `UNKNOWN` | unknown | | `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 | | `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 | | `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | | `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-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 | | | `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *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_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 | | | `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 | | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *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 | | | `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 ## Supported Types
### `components.OpenResponsesRequestPluginAutoRouter`
```python
value: components.OpenResponsesRequestPluginAutoRouter = /* values here */
```
### `components.OpenResponsesRequestPluginModeration` ### `components.OpenResponsesRequestPluginModeration`
```python ```python
@@ -6,7 +6,7 @@ When multiple model providers are available, optionally indicate your routing pr
## Fields ## Fields
| Field | Type | Required | Description | Example | | 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/> | | | `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. | | | `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 | | `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 |
@@ -18,7 +18,5 @@ When multiple model providers are available, optionally indicate your routing pr
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `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 | | `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. | | | `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_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[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 | | `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 |
| ~~`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 |
@@ -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 */
```
+2 -1
View File
@@ -4,7 +4,8 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ | | -------------------- | -------------------- | -------------------- | -------------------- |
| `cached_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | | `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 | | `audio_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A |
| `video_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 | | `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli | | `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud | | `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google | | `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio | | `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq | | `GROQ` | Groq |
| `HYPERBOLIC` | Hyperbolic | | `HYPERBOLIC` | Hyperbolic |
| `INCEPTION` | Inception | | `INCEPTION` | Inception |
| `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet | | `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic | | `INFERMATIC` | Infermatic |
| `INFLECTION` | Inflection | | `INFLECTION` | Inflection |
@@ -61,13 +61,14 @@
| `PHALA` | Phala | | `PHALA` | Phala |
| `RELACE` | Relace | | `RELACE` | Relace |
| `SAMBA_NOVA` | SambaNova | | `SAMBA_NOVA` | SambaNova |
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow | | `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful | | `SOURCEFUL` | Sourceful |
| `STEALTH` | Stealth | | `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake | | `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint | | `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon |
| `TOGETHER` | Together | | `TOGETHER` | Together |
| `UPSTAGE` | Upstage |
| `VENICE` | Venice | | `VENICE` | Venice |
| `WAND_B` | WandB | | `WAND_B` | WandB |
| `XIAOMI` | Xiaomi | | `XIAOMI` | Xiaomi |
+3 -5
View File
@@ -6,7 +6,7 @@ Provider routing preferences for the request.
## Fields ## Fields
| Field | Type | Required | Description | Example | | 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/> | | | `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. | | | `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 | | `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 |
@@ -18,7 +18,5 @@ Provider routing preferences for the request.
| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | | `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 | | | `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. | | | `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_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[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 | | `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 |
| ~~`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 |
+3 -1
View File
@@ -6,7 +6,7 @@ Information about a specific model endpoint
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | *str* | :heavy_check_mark: | N/A | | | `name` | *str* | :heavy_check_mark: | N/A | |
| `model_name` | *str* | :heavy_check_mark: | N/A | | | `model_name` | *str* | :heavy_check_mark: | N/A | |
| `context_length` | *float* | :heavy_check_mark: | N/A | | | `context_length` | *float* | :heavy_check_mark: | N/A | |
@@ -20,3 +20,5 @@ Information about a specific model endpoint
| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 | | `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 |
| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | | `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | |
| `supports_implicit_caching` | *bool* | :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 |
+1
View File
@@ -8,3 +8,4 @@
| `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A | | `type` | [components.ResponseOutputTextType](../components/responseoutputtexttype.md) | :heavy_check_mark: | N/A |
| `text` | *str* | :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 ## Fields
@@ -6,5 +6,5 @@
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ | | ------------------ | ------------------ | ------------------ | ------------------ |
| `token` | *str* | :heavy_check_mark: | N/A | | `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 ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A | | `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A | |
| `id` | *str* | :heavy_check_mark: | N/A | | `id` | *str* | :heavy_check_mark: | N/A | |
| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | 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 | | `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A | |
| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `status` | [Optional[components.ResponsesOutputItemReasoningStatusUnion]](../components/responsesoutputitemreasoningstatusunion.md) | :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 | | `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli | | `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud | | `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google | | `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio | | `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq | | `GROQ` | Groq |
| `HYPERBOLIC` | Hyperbolic | | `HYPERBOLIC` | Hyperbolic |
| `INCEPTION` | Inception | | `INCEPTION` | Inception |
| `INCEPTRON` | Inceptron |
| `INFERENCE_NET` | InferenceNet | | `INFERENCE_NET` | InferenceNet |
| `INFERMATIC` | Infermatic | | `INFERMATIC` | Infermatic |
| `INFLECTION` | Inflection | | `INFLECTION` | Inflection |
@@ -61,13 +61,14 @@
| `PHALA` | Phala | | `PHALA` | Phala |
| `RELACE` | Relace | | `RELACE` | Relace |
| `SAMBA_NOVA` | SambaNova | | `SAMBA_NOVA` | SambaNova |
| `SEED` | Seed |
| `SILICON_FLOW` | SiliconFlow | | `SILICON_FLOW` | SiliconFlow |
| `SOURCEFUL` | Sourceful | | `SOURCEFUL` | Sourceful |
| `STEALTH` | Stealth | | `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake | | `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint | | `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon |
| `TOGETHER` | Together | | `TOGETHER` | Together |
| `UPSTAGE` | Upstage |
| `VENICE` | Venice | | `VENICE` | Venice |
| `WAND_B` | WandB | | `WAND_B` | WandB |
| `XIAOMI` | Xiaomi | | `XIAOMI` | Xiaomi |
+2 -1
View File
@@ -4,9 +4,10 @@
## Values ## Values
| Name | Value | | Name | Value |
| --------------------- | --------------------- | | --------------------------- | --------------------------- |
| `UNKNOWN` | unknown | | `UNKNOWN` | unknown |
| `OPENAI_RESPONSES_V1` | openai-responses-v1 | | `OPENAI_RESPONSES_V1` | openai-responses-v1 |
| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 |
| `XAI_RESPONSES_V1` | xai-responses-v1 | | `XAI_RESPONSES_V1` | xai-responses-v1 |
| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | | `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 |
| `GOOGLE_GEMINI_V1` | google-gemini-v1 | | `GOOGLE_GEMINI_V1` | google-gemini-v1 |
+1
View File
@@ -39,3 +39,4 @@ Generation data
| `native_finish_reason` | *Nullable[str]* | :heavy_check_mark: | Native finish reason as reported by provider | stop | | `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 | | `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 | | `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :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 |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response ### Response
+6
View File
@@ -51,7 +51,13 @@ with OpenRouter(
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *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_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 | | | `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 | | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *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 | | | `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | |
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.0.17" version = "0.1.2"
description = "Official Python Client SDK for OpenRouter." description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },] authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md" readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata import importlib.metadata
__title__: str = "openrouter" __title__: str = "openrouter"
__version__: str = "0.0.17" __version__: str = "0.0.18"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.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: try:
if __package__ is not None: if __package__ is not None:
+58
View File
@@ -76,6 +76,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -112,6 +119,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -179,6 +188,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -215,6 +231,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -281,6 +299,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -317,6 +342,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :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, top_p=top_p,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]), debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
image_config=image_config,
modalities=modalities,
) )
req = self._build_request( req = self._build_request(
@@ -523,6 +552,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -559,6 +595,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -626,6 +664,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -662,6 +707,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -728,6 +775,13 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, 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, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -764,6 +818,8 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param debug: :param debug:
:param image_config:
:param modalities:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL 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 :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, top_p=top_p,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]), debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
image_config=image_config,
modalities=modalities,
) )
req = self._build_request_async( req = self._build_request_async(
+171 -30
View File
@@ -38,8 +38,12 @@ if TYPE_CHECKING:
from .chatgenerationparams import ( from .chatgenerationparams import (
ChatGenerationParams, ChatGenerationParams,
ChatGenerationParamsDataCollection, ChatGenerationParamsDataCollection,
ChatGenerationParamsImageConfig,
ChatGenerationParamsImageConfigTypedDict,
ChatGenerationParamsMaxPrice, ChatGenerationParamsMaxPrice,
ChatGenerationParamsMaxPriceTypedDict, ChatGenerationParamsMaxPriceTypedDict,
ChatGenerationParamsPluginAutoRouter,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParser, ChatGenerationParamsPluginFileParser,
ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginModeration, ChatGenerationParamsPluginModeration,
@@ -50,6 +54,14 @@ if TYPE_CHECKING:
ChatGenerationParamsPluginUnionTypedDict, ChatGenerationParamsPluginUnionTypedDict,
ChatGenerationParamsPluginWeb, ChatGenerationParamsPluginWeb,
ChatGenerationParamsPluginWebTypedDict, ChatGenerationParamsPluginWebTypedDict,
ChatGenerationParamsPreferredMaxLatency,
ChatGenerationParamsPreferredMaxLatencyTypedDict,
ChatGenerationParamsPreferredMaxLatencyUnion,
ChatGenerationParamsPreferredMaxLatencyUnionTypedDict,
ChatGenerationParamsPreferredMinThroughput,
ChatGenerationParamsPreferredMinThroughputTypedDict,
ChatGenerationParamsPreferredMinThroughputUnion,
ChatGenerationParamsPreferredMinThroughputUnionTypedDict,
ChatGenerationParamsProvider, ChatGenerationParamsProvider,
ChatGenerationParamsProviderTypedDict, ChatGenerationParamsProviderTypedDict,
ChatGenerationParamsResponseFormatJSONObject, ChatGenerationParamsResponseFormatJSONObject,
@@ -67,6 +79,7 @@ if TYPE_CHECKING:
DebugTypedDict, DebugTypedDict,
Effort, Effort,
Engine, Engine,
Modality,
Pdf, Pdf,
PdfEngine, PdfEngine,
PdfTypedDict, PdfTypedDict,
@@ -123,9 +136,9 @@ if TYPE_CHECKING:
) )
from .chatmessagetokenlogprob import ( from .chatmessagetokenlogprob import (
ChatMessageTokenLogprob, ChatMessageTokenLogprob,
ChatMessageTokenLogprobTopLogprob,
ChatMessageTokenLogprobTopLogprobTypedDict,
ChatMessageTokenLogprobTypedDict, ChatMessageTokenLogprobTypedDict,
TopLogprob,
TopLogprobTypedDict,
) )
from .chatmessagetokenlogprobs import ( from .chatmessagetokenlogprobs import (
ChatMessageTokenLogprobs, ChatMessageTokenLogprobs,
@@ -333,17 +346,21 @@ if TYPE_CHECKING:
from .openairesponsestruncation import OpenAIResponsesTruncation from .openairesponsestruncation import OpenAIResponsesTruncation
from .openresponseseasyinputmessage import ( from .openresponseseasyinputmessage import (
OpenResponsesEasyInputMessage, OpenResponsesEasyInputMessage,
OpenResponsesEasyInputMessageContent1, OpenResponsesEasyInputMessageContentInputImage,
OpenResponsesEasyInputMessageContent1TypedDict, OpenResponsesEasyInputMessageContentInputImageTypedDict,
OpenResponsesEasyInputMessageContent2, OpenResponsesEasyInputMessageContentType,
OpenResponsesEasyInputMessageContent2TypedDict, OpenResponsesEasyInputMessageContentUnion1,
OpenResponsesEasyInputMessageContentUnion1TypedDict,
OpenResponsesEasyInputMessageContentUnion2,
OpenResponsesEasyInputMessageContentUnion2TypedDict,
OpenResponsesEasyInputMessageDetail,
OpenResponsesEasyInputMessageRoleAssistant, OpenResponsesEasyInputMessageRoleAssistant,
OpenResponsesEasyInputMessageRoleDeveloper, OpenResponsesEasyInputMessageRoleDeveloper,
OpenResponsesEasyInputMessageRoleSystem, OpenResponsesEasyInputMessageRoleSystem,
OpenResponsesEasyInputMessageRoleUnion, OpenResponsesEasyInputMessageRoleUnion,
OpenResponsesEasyInputMessageRoleUnionTypedDict, OpenResponsesEasyInputMessageRoleUnionTypedDict,
OpenResponsesEasyInputMessageRoleUser, OpenResponsesEasyInputMessageRoleUser,
OpenResponsesEasyInputMessageType, OpenResponsesEasyInputMessageTypeMessage,
OpenResponsesEasyInputMessageTypedDict, OpenResponsesEasyInputMessageTypedDict,
) )
from .openresponseserrorevent import ( from .openresponseserrorevent import (
@@ -389,14 +406,18 @@ if TYPE_CHECKING:
) )
from .openresponsesinputmessageitem import ( from .openresponsesinputmessageitem import (
OpenResponsesInputMessageItem, OpenResponsesInputMessageItem,
OpenResponsesInputMessageItemContent, OpenResponsesInputMessageItemContentInputImage,
OpenResponsesInputMessageItemContentTypedDict, OpenResponsesInputMessageItemContentInputImageTypedDict,
OpenResponsesInputMessageItemContentType,
OpenResponsesInputMessageItemContentUnion,
OpenResponsesInputMessageItemContentUnionTypedDict,
OpenResponsesInputMessageItemDetail,
OpenResponsesInputMessageItemRoleDeveloper, OpenResponsesInputMessageItemRoleDeveloper,
OpenResponsesInputMessageItemRoleSystem, OpenResponsesInputMessageItemRoleSystem,
OpenResponsesInputMessageItemRoleUnion, OpenResponsesInputMessageItemRoleUnion,
OpenResponsesInputMessageItemRoleUnionTypedDict, OpenResponsesInputMessageItemRoleUnionTypedDict,
OpenResponsesInputMessageItemRoleUser, OpenResponsesInputMessageItemRoleUser,
OpenResponsesInputMessageItemType, OpenResponsesInputMessageItemTypeMessage,
OpenResponsesInputMessageItemTypedDict, OpenResponsesInputMessageItemTypedDict,
) )
from .openresponseslogprobs import ( from .openresponseslogprobs import (
@@ -454,6 +475,7 @@ if TYPE_CHECKING:
OpenResponsesReasoningSummaryTextDoneEventTypedDict, OpenResponsesReasoningSummaryTextDoneEventTypedDict,
) )
from .openresponsesrequest import ( from .openresponsesrequest import (
IDAutoRouter,
IDFileParser, IDFileParser,
IDModeration, IDModeration,
IDResponseHealing, IDResponseHealing,
@@ -461,12 +483,16 @@ if TYPE_CHECKING:
OpenResponsesRequest, OpenResponsesRequest,
OpenResponsesRequestIgnore, OpenResponsesRequestIgnore,
OpenResponsesRequestIgnoreTypedDict, OpenResponsesRequestIgnoreTypedDict,
OpenResponsesRequestImageConfig,
OpenResponsesRequestImageConfigTypedDict,
OpenResponsesRequestMaxPrice, OpenResponsesRequestMaxPrice,
OpenResponsesRequestMaxPriceTypedDict, OpenResponsesRequestMaxPriceTypedDict,
OpenResponsesRequestOnly, OpenResponsesRequestOnly,
OpenResponsesRequestOnlyTypedDict, OpenResponsesRequestOnlyTypedDict,
OpenResponsesRequestOrder, OpenResponsesRequestOrder,
OpenResponsesRequestOrderTypedDict, OpenResponsesRequestOrderTypedDict,
OpenResponsesRequestPluginAutoRouter,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParser, OpenResponsesRequestPluginFileParser,
OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginModeration, OpenResponsesRequestPluginModeration,
@@ -622,7 +648,21 @@ if TYPE_CHECKING:
) )
from .pdfparserengine import PDFParserEngine from .pdfparserengine import PDFParserEngine
from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict 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 .perrequestlimits import PerRequestLimits, PerRequestLimitsTypedDict
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName from .providername import ProviderName
from .provideroverloadedresponseerrordata import ( from .provideroverloadedresponseerrordata import (
ProviderOverloadedResponseErrorData, ProviderOverloadedResponseErrorData,
@@ -717,8 +757,17 @@ if TYPE_CHECKING:
ResponseInputTextType, ResponseInputTextType,
ResponseInputTextTypedDict, ResponseInputTextTypedDict,
) )
from .responseinputvideo import (
ResponseInputVideo,
ResponseInputVideoType,
ResponseInputVideoTypedDict,
)
from .responseoutputtext import ( from .responseoutputtext import (
Logprob,
LogprobTypedDict,
ResponseOutputText, ResponseOutputText,
ResponseOutputTextTopLogprob,
ResponseOutputTextTopLogprobTypedDict,
ResponseOutputTextType, ResponseOutputTextType,
ResponseOutputTextTypedDict, ResponseOutputTextTypedDict,
) )
@@ -765,6 +814,7 @@ if TYPE_CHECKING:
) )
from .responsesoutputitemreasoning import ( from .responsesoutputitemreasoning import (
ResponsesOutputItemReasoning, ResponsesOutputItemReasoning,
ResponsesOutputItemReasoningFormat,
ResponsesOutputItemReasoningStatusCompleted, ResponsesOutputItemReasoningStatusCompleted,
ResponsesOutputItemReasoningStatusInProgress, ResponsesOutputItemReasoningStatusInProgress,
ResponsesOutputItemReasoningStatusIncomplete, ResponsesOutputItemReasoningStatusIncomplete,
@@ -786,6 +836,7 @@ if TYPE_CHECKING:
ResponsesOutputMessageType, ResponsesOutputMessageType,
ResponsesOutputMessageTypedDict, ResponsesOutputMessageTypedDict,
) )
from .responsesoutputmodality import ResponsesOutputModality
from .responsessearchcontextsize import ResponsesSearchContextSize from .responsessearchcontextsize import ResponsesSearchContextSize
from .responseswebsearchcalloutput import ( from .responseswebsearchcalloutput import (
ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput,
@@ -873,8 +924,12 @@ __all__ = [
"ChatErrorErrorTypedDict", "ChatErrorErrorTypedDict",
"ChatGenerationParams", "ChatGenerationParams",
"ChatGenerationParamsDataCollection", "ChatGenerationParamsDataCollection",
"ChatGenerationParamsImageConfig",
"ChatGenerationParamsImageConfigTypedDict",
"ChatGenerationParamsMaxPrice", "ChatGenerationParamsMaxPrice",
"ChatGenerationParamsMaxPriceTypedDict", "ChatGenerationParamsMaxPriceTypedDict",
"ChatGenerationParamsPluginAutoRouter",
"ChatGenerationParamsPluginAutoRouterTypedDict",
"ChatGenerationParamsPluginFileParser", "ChatGenerationParamsPluginFileParser",
"ChatGenerationParamsPluginFileParserTypedDict", "ChatGenerationParamsPluginFileParserTypedDict",
"ChatGenerationParamsPluginModeration", "ChatGenerationParamsPluginModeration",
@@ -885,6 +940,14 @@ __all__ = [
"ChatGenerationParamsPluginUnionTypedDict", "ChatGenerationParamsPluginUnionTypedDict",
"ChatGenerationParamsPluginWeb", "ChatGenerationParamsPluginWeb",
"ChatGenerationParamsPluginWebTypedDict", "ChatGenerationParamsPluginWebTypedDict",
"ChatGenerationParamsPreferredMaxLatency",
"ChatGenerationParamsPreferredMaxLatencyTypedDict",
"ChatGenerationParamsPreferredMaxLatencyUnion",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict",
"ChatGenerationParamsPreferredMinThroughput",
"ChatGenerationParamsPreferredMinThroughputTypedDict",
"ChatGenerationParamsPreferredMinThroughputUnion",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict",
"ChatGenerationParamsProvider", "ChatGenerationParamsProvider",
"ChatGenerationParamsProviderTypedDict", "ChatGenerationParamsProviderTypedDict",
"ChatGenerationParamsResponseFormatJSONObject", "ChatGenerationParamsResponseFormatJSONObject",
@@ -920,6 +983,8 @@ __all__ = [
"ChatMessageContentItemVideoVideoURL", "ChatMessageContentItemVideoVideoURL",
"ChatMessageContentItemVideoVideoURLTypedDict", "ChatMessageContentItemVideoVideoURLTypedDict",
"ChatMessageTokenLogprob", "ChatMessageTokenLogprob",
"ChatMessageTokenLogprobTopLogprob",
"ChatMessageTokenLogprobTopLogprobTypedDict",
"ChatMessageTokenLogprobTypedDict", "ChatMessageTokenLogprobTypedDict",
"ChatMessageTokenLogprobs", "ChatMessageTokenLogprobs",
"ChatMessageTokenLogprobsTypedDict", "ChatMessageTokenLogprobsTypedDict",
@@ -996,6 +1061,7 @@ __all__ = [
"FilePathTypedDict", "FilePathTypedDict",
"ForbiddenResponseErrorData", "ForbiddenResponseErrorData",
"ForbiddenResponseErrorDataTypedDict", "ForbiddenResponseErrorDataTypedDict",
"IDAutoRouter",
"IDFileParser", "IDFileParser",
"IDModeration", "IDModeration",
"IDResponseHealing", "IDResponseHealing",
@@ -1013,12 +1079,15 @@ __all__ = [
"JSONSchemaConfigTypedDict", "JSONSchemaConfigTypedDict",
"ListEndpointsResponse", "ListEndpointsResponse",
"ListEndpointsResponseTypedDict", "ListEndpointsResponseTypedDict",
"Logprob",
"LogprobTypedDict",
"Message", "Message",
"MessageContent", "MessageContent",
"MessageContentTypedDict", "MessageContentTypedDict",
"MessageDeveloper", "MessageDeveloper",
"MessageDeveloperTypedDict", "MessageDeveloperTypedDict",
"MessageTypedDict", "MessageTypedDict",
"Modality",
"Model", "Model",
"ModelArchitecture", "ModelArchitecture",
"ModelArchitectureInstructType", "ModelArchitectureInstructType",
@@ -1100,17 +1169,21 @@ __all__ = [
"OpenAIResponsesToolChoiceUnionTypedDict", "OpenAIResponsesToolChoiceUnionTypedDict",
"OpenAIResponsesTruncation", "OpenAIResponsesTruncation",
"OpenResponsesEasyInputMessage", "OpenResponsesEasyInputMessage",
"OpenResponsesEasyInputMessageContent1", "OpenResponsesEasyInputMessageContentInputImage",
"OpenResponsesEasyInputMessageContent1TypedDict", "OpenResponsesEasyInputMessageContentInputImageTypedDict",
"OpenResponsesEasyInputMessageContent2", "OpenResponsesEasyInputMessageContentType",
"OpenResponsesEasyInputMessageContent2TypedDict", "OpenResponsesEasyInputMessageContentUnion1",
"OpenResponsesEasyInputMessageContentUnion1TypedDict",
"OpenResponsesEasyInputMessageContentUnion2",
"OpenResponsesEasyInputMessageContentUnion2TypedDict",
"OpenResponsesEasyInputMessageDetail",
"OpenResponsesEasyInputMessageRoleAssistant", "OpenResponsesEasyInputMessageRoleAssistant",
"OpenResponsesEasyInputMessageRoleDeveloper", "OpenResponsesEasyInputMessageRoleDeveloper",
"OpenResponsesEasyInputMessageRoleSystem", "OpenResponsesEasyInputMessageRoleSystem",
"OpenResponsesEasyInputMessageRoleUnion", "OpenResponsesEasyInputMessageRoleUnion",
"OpenResponsesEasyInputMessageRoleUnionTypedDict", "OpenResponsesEasyInputMessageRoleUnionTypedDict",
"OpenResponsesEasyInputMessageRoleUser", "OpenResponsesEasyInputMessageRoleUser",
"OpenResponsesEasyInputMessageType", "OpenResponsesEasyInputMessageTypeMessage",
"OpenResponsesEasyInputMessageTypedDict", "OpenResponsesEasyInputMessageTypedDict",
"OpenResponsesErrorEvent", "OpenResponsesErrorEvent",
"OpenResponsesErrorEventType", "OpenResponsesErrorEventType",
@@ -1137,14 +1210,18 @@ __all__ = [
"OpenResponsesInput1", "OpenResponsesInput1",
"OpenResponsesInput1TypedDict", "OpenResponsesInput1TypedDict",
"OpenResponsesInputMessageItem", "OpenResponsesInputMessageItem",
"OpenResponsesInputMessageItemContent", "OpenResponsesInputMessageItemContentInputImage",
"OpenResponsesInputMessageItemContentTypedDict", "OpenResponsesInputMessageItemContentInputImageTypedDict",
"OpenResponsesInputMessageItemContentType",
"OpenResponsesInputMessageItemContentUnion",
"OpenResponsesInputMessageItemContentUnionTypedDict",
"OpenResponsesInputMessageItemDetail",
"OpenResponsesInputMessageItemRoleDeveloper", "OpenResponsesInputMessageItemRoleDeveloper",
"OpenResponsesInputMessageItemRoleSystem", "OpenResponsesInputMessageItemRoleSystem",
"OpenResponsesInputMessageItemRoleUnion", "OpenResponsesInputMessageItemRoleUnion",
"OpenResponsesInputMessageItemRoleUnionTypedDict", "OpenResponsesInputMessageItemRoleUnionTypedDict",
"OpenResponsesInputMessageItemRoleUser", "OpenResponsesInputMessageItemRoleUser",
"OpenResponsesInputMessageItemType", "OpenResponsesInputMessageItemTypeMessage",
"OpenResponsesInputMessageItemTypedDict", "OpenResponsesInputMessageItemTypedDict",
"OpenResponsesInputTypedDict", "OpenResponsesInputTypedDict",
"OpenResponsesLogProbs", "OpenResponsesLogProbs",
@@ -1185,12 +1262,16 @@ __all__ = [
"OpenResponsesRequest", "OpenResponsesRequest",
"OpenResponsesRequestIgnore", "OpenResponsesRequestIgnore",
"OpenResponsesRequestIgnoreTypedDict", "OpenResponsesRequestIgnoreTypedDict",
"OpenResponsesRequestImageConfig",
"OpenResponsesRequestImageConfigTypedDict",
"OpenResponsesRequestMaxPrice", "OpenResponsesRequestMaxPrice",
"OpenResponsesRequestMaxPriceTypedDict", "OpenResponsesRequestMaxPriceTypedDict",
"OpenResponsesRequestOnly", "OpenResponsesRequestOnly",
"OpenResponsesRequestOnlyTypedDict", "OpenResponsesRequestOnlyTypedDict",
"OpenResponsesRequestOrder", "OpenResponsesRequestOrder",
"OpenResponsesRequestOrderTypedDict", "OpenResponsesRequestOrderTypedDict",
"OpenResponsesRequestPluginAutoRouter",
"OpenResponsesRequestPluginAutoRouterTypedDict",
"OpenResponsesRequestPluginFileParser", "OpenResponsesRequestPluginFileParser",
"OpenResponsesRequestPluginFileParserTypedDict", "OpenResponsesRequestPluginFileParserTypedDict",
"OpenResponsesRequestPluginModeration", "OpenResponsesRequestPluginModeration",
@@ -1305,6 +1386,16 @@ __all__ = [
"PdfTypedDict", "PdfTypedDict",
"PerRequestLimits", "PerRequestLimits",
"PerRequestLimitsTypedDict", "PerRequestLimitsTypedDict",
"PercentileLatencyCutoffs",
"PercentileLatencyCutoffsTypedDict",
"PercentileStats",
"PercentileStatsTypedDict",
"PercentileThroughputCutoffs",
"PercentileThroughputCutoffsTypedDict",
"PreferredMaxLatency",
"PreferredMaxLatencyTypedDict",
"PreferredMinThroughput",
"PreferredMinThroughputTypedDict",
"Pricing", "Pricing",
"PricingTypedDict", "PricingTypedDict",
"Prompt", "Prompt",
@@ -1379,7 +1470,12 @@ __all__ = [
"ResponseInputText", "ResponseInputText",
"ResponseInputTextType", "ResponseInputTextType",
"ResponseInputTextTypedDict", "ResponseInputTextTypedDict",
"ResponseInputVideo",
"ResponseInputVideoType",
"ResponseInputVideoTypedDict",
"ResponseOutputText", "ResponseOutputText",
"ResponseOutputTextTopLogprob",
"ResponseOutputTextTopLogprobTypedDict",
"ResponseOutputTextType", "ResponseOutputTextType",
"ResponseOutputTextTypedDict", "ResponseOutputTextTypedDict",
"ResponseTextConfig", "ResponseTextConfig",
@@ -1412,6 +1508,7 @@ __all__ = [
"ResponsesOutputItemFunctionCallType", "ResponsesOutputItemFunctionCallType",
"ResponsesOutputItemFunctionCallTypedDict", "ResponsesOutputItemFunctionCallTypedDict",
"ResponsesOutputItemReasoning", "ResponsesOutputItemReasoning",
"ResponsesOutputItemReasoningFormat",
"ResponsesOutputItemReasoningStatusCompleted", "ResponsesOutputItemReasoningStatusCompleted",
"ResponsesOutputItemReasoningStatusInProgress", "ResponsesOutputItemReasoningStatusInProgress",
"ResponsesOutputItemReasoningStatusIncomplete", "ResponsesOutputItemReasoningStatusIncomplete",
@@ -1431,6 +1528,7 @@ __all__ = [
"ResponsesOutputMessageStatusUnionTypedDict", "ResponsesOutputMessageStatusUnionTypedDict",
"ResponsesOutputMessageType", "ResponsesOutputMessageType",
"ResponsesOutputMessageTypedDict", "ResponsesOutputMessageTypedDict",
"ResponsesOutputModality",
"ResponsesSearchContextSize", "ResponsesSearchContextSize",
"ResponsesWebSearchCallOutput", "ResponsesWebSearchCallOutput",
"ResponsesWebSearchCallOutputType", "ResponsesWebSearchCallOutputType",
@@ -1476,8 +1574,6 @@ __all__ = [
"ToolResponseMessageContent", "ToolResponseMessageContent",
"ToolResponseMessageContentTypedDict", "ToolResponseMessageContentTypedDict",
"ToolResponseMessageTypedDict", "ToolResponseMessageTypedDict",
"TopLogprob",
"TopLogprobTypedDict",
"TopProviderInfo", "TopProviderInfo",
"TopProviderInfoTypedDict", "TopProviderInfoTypedDict",
"Truncation", "Truncation",
@@ -1554,8 +1650,12 @@ _dynamic_imports: dict[str, str] = {
"CodeTypedDict": ".chaterror", "CodeTypedDict": ".chaterror",
"ChatGenerationParams": ".chatgenerationparams", "ChatGenerationParams": ".chatgenerationparams",
"ChatGenerationParamsDataCollection": ".chatgenerationparams", "ChatGenerationParamsDataCollection": ".chatgenerationparams",
"ChatGenerationParamsImageConfig": ".chatgenerationparams",
"ChatGenerationParamsImageConfigTypedDict": ".chatgenerationparams",
"ChatGenerationParamsMaxPrice": ".chatgenerationparams", "ChatGenerationParamsMaxPrice": ".chatgenerationparams",
"ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams", "ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams", "ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginModeration": ".chatgenerationparams", "ChatGenerationParamsPluginModeration": ".chatgenerationparams",
@@ -1566,6 +1666,14 @@ _dynamic_imports: dict[str, str] = {
"ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginWeb": ".chatgenerationparams", "ChatGenerationParamsPluginWeb": ".chatgenerationparams",
"ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatency": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMaxLatencyUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughput": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnion": ".chatgenerationparams",
"ChatGenerationParamsPreferredMinThroughputUnionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsProvider": ".chatgenerationparams", "ChatGenerationParamsProvider": ".chatgenerationparams",
"ChatGenerationParamsProviderTypedDict": ".chatgenerationparams", "ChatGenerationParamsProviderTypedDict": ".chatgenerationparams",
"ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams", "ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams",
@@ -1583,6 +1691,7 @@ _dynamic_imports: dict[str, str] = {
"DebugTypedDict": ".chatgenerationparams", "DebugTypedDict": ".chatgenerationparams",
"Effort": ".chatgenerationparams", "Effort": ".chatgenerationparams",
"Engine": ".chatgenerationparams", "Engine": ".chatgenerationparams",
"Modality": ".chatgenerationparams",
"Pdf": ".chatgenerationparams", "Pdf": ".chatgenerationparams",
"PdfEngine": ".chatgenerationparams", "PdfEngine": ".chatgenerationparams",
"PdfTypedDict": ".chatgenerationparams", "PdfTypedDict": ".chatgenerationparams",
@@ -1623,9 +1732,9 @@ _dynamic_imports: dict[str, str] = {
"VideoURL2": ".chatmessagecontentitemvideo", "VideoURL2": ".chatmessagecontentitemvideo",
"VideoURL2TypedDict": ".chatmessagecontentitemvideo", "VideoURL2TypedDict": ".chatmessagecontentitemvideo",
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob", "ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTopLogprob": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTopLogprobTypedDict": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob", "ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
"TopLogprob": ".chatmessagetokenlogprob",
"TopLogprobTypedDict": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs", "ChatMessageTokenLogprobs": ".chatmessagetokenlogprobs",
"ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs", "ChatMessageTokenLogprobsTypedDict": ".chatmessagetokenlogprobs",
"ChatMessageToolCall": ".chatmessagetoolcall", "ChatMessageToolCall": ".chatmessagetoolcall",
@@ -1798,17 +1907,21 @@ _dynamic_imports: dict[str, str] = {
"TypeTypedDict": ".openairesponsestoolchoice_union", "TypeTypedDict": ".openairesponsestoolchoice_union",
"OpenAIResponsesTruncation": ".openairesponsestruncation", "OpenAIResponsesTruncation": ".openairesponsestruncation",
"OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent1": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentInputImage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent1TypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentInputImageTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent2": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentType": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContent2TypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageContentUnion1": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion1TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion2": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageContentUnion2TypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageDetail": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleAssistant": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleDeveloper": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleSystem": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleUnion": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleUnionTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageRoleUser": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageType": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageTypeMessage": ".openresponseseasyinputmessage",
"OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage", "OpenResponsesEasyInputMessageTypedDict": ".openresponseseasyinputmessage",
"OpenResponsesErrorEvent": ".openresponseserrorevent", "OpenResponsesErrorEvent": ".openresponseserrorevent",
"OpenResponsesErrorEventType": ".openresponseserrorevent", "OpenResponsesErrorEventType": ".openresponseserrorevent",
@@ -1836,14 +1949,18 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesInput1TypedDict": ".openresponsesinput", "OpenResponsesInput1TypedDict": ".openresponsesinput",
"OpenResponsesInputTypedDict": ".openresponsesinput", "OpenResponsesInputTypedDict": ".openresponsesinput",
"OpenResponsesInputMessageItem": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItem": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContent": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemContentInputImage": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentTypedDict": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemContentInputImageTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentType": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentUnion": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemContentUnionTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemDetail": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemRoleDeveloper": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemRoleSystem": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemRoleUnion": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemRoleUnionTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemRoleUser": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemType": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemTypeMessage": ".openresponsesinputmessageitem",
"OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem", "OpenResponsesInputMessageItemTypedDict": ".openresponsesinputmessageitem",
"OpenResponsesLogProbs": ".openresponseslogprobs", "OpenResponsesLogProbs": ".openresponseslogprobs",
"OpenResponsesLogProbsTypedDict": ".openresponseslogprobs", "OpenResponsesLogProbsTypedDict": ".openresponseslogprobs",
@@ -1881,6 +1998,7 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesReasoningSummaryTextDoneEvent": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEvent": ".openresponsesreasoningsummarytextdoneevent",
"OpenResponsesReasoningSummaryTextDoneEventType": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEventType": ".openresponsesreasoningsummarytextdoneevent",
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
"IDAutoRouter": ".openresponsesrequest",
"IDFileParser": ".openresponsesrequest", "IDFileParser": ".openresponsesrequest",
"IDModeration": ".openresponsesrequest", "IDModeration": ".openresponsesrequest",
"IDResponseHealing": ".openresponsesrequest", "IDResponseHealing": ".openresponsesrequest",
@@ -1888,12 +2006,16 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesRequest": ".openresponsesrequest", "OpenResponsesRequest": ".openresponsesrequest",
"OpenResponsesRequestIgnore": ".openresponsesrequest", "OpenResponsesRequestIgnore": ".openresponsesrequest",
"OpenResponsesRequestIgnoreTypedDict": ".openresponsesrequest", "OpenResponsesRequestIgnoreTypedDict": ".openresponsesrequest",
"OpenResponsesRequestImageConfig": ".openresponsesrequest",
"OpenResponsesRequestImageConfigTypedDict": ".openresponsesrequest",
"OpenResponsesRequestMaxPrice": ".openresponsesrequest", "OpenResponsesRequestMaxPrice": ".openresponsesrequest",
"OpenResponsesRequestMaxPriceTypedDict": ".openresponsesrequest", "OpenResponsesRequestMaxPriceTypedDict": ".openresponsesrequest",
"OpenResponsesRequestOnly": ".openresponsesrequest", "OpenResponsesRequestOnly": ".openresponsesrequest",
"OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest", "OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest",
"OpenResponsesRequestOrder": ".openresponsesrequest", "OpenResponsesRequestOrder": ".openresponsesrequest",
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest", "OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest", "OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginModeration": ".openresponsesrequest", "OpenResponsesRequestPluginModeration": ".openresponsesrequest",
@@ -2025,8 +2147,18 @@ _dynamic_imports: dict[str, str] = {
"PDFParserEngine": ".pdfparserengine", "PDFParserEngine": ".pdfparserengine",
"PDFParserOptions": ".pdfparseroptions", "PDFParserOptions": ".pdfparseroptions",
"PDFParserOptionsTypedDict": ".pdfparseroptions", "PDFParserOptionsTypedDict": ".pdfparseroptions",
"PercentileLatencyCutoffs": ".percentilelatencycutoffs",
"PercentileLatencyCutoffsTypedDict": ".percentilelatencycutoffs",
"PercentileStats": ".percentilestats",
"PercentileStatsTypedDict": ".percentilestats",
"PercentileThroughputCutoffs": ".percentilethroughputcutoffs",
"PercentileThroughputCutoffsTypedDict": ".percentilethroughputcutoffs",
"PerRequestLimits": ".perrequestlimits", "PerRequestLimits": ".perrequestlimits",
"PerRequestLimitsTypedDict": ".perrequestlimits", "PerRequestLimitsTypedDict": ".perrequestlimits",
"PreferredMaxLatency": ".preferredmaxlatency",
"PreferredMaxLatencyTypedDict": ".preferredmaxlatency",
"PreferredMinThroughput": ".preferredminthroughput",
"PreferredMinThroughputTypedDict": ".preferredminthroughput",
"ProviderName": ".providername", "ProviderName": ".providername",
"ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata", "ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata",
"ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata", "ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata",
@@ -2095,7 +2227,14 @@ _dynamic_imports: dict[str, str] = {
"ResponseInputText": ".responseinputtext", "ResponseInputText": ".responseinputtext",
"ResponseInputTextType": ".responseinputtext", "ResponseInputTextType": ".responseinputtext",
"ResponseInputTextTypedDict": ".responseinputtext", "ResponseInputTextTypedDict": ".responseinputtext",
"ResponseInputVideo": ".responseinputvideo",
"ResponseInputVideoType": ".responseinputvideo",
"ResponseInputVideoTypedDict": ".responseinputvideo",
"Logprob": ".responseoutputtext",
"LogprobTypedDict": ".responseoutputtext",
"ResponseOutputText": ".responseoutputtext", "ResponseOutputText": ".responseoutputtext",
"ResponseOutputTextTopLogprob": ".responseoutputtext",
"ResponseOutputTextTopLogprobTypedDict": ".responseoutputtext",
"ResponseOutputTextType": ".responseoutputtext", "ResponseOutputTextType": ".responseoutputtext",
"ResponseOutputTextTypedDict": ".responseoutputtext", "ResponseOutputTextTypedDict": ".responseoutputtext",
"CodeEnum": ".responseserrorfield", "CodeEnum": ".responseserrorfield",
@@ -2127,6 +2266,7 @@ _dynamic_imports: dict[str, str] = {
"ResponsesOutputItemFunctionCallType": ".responsesoutputitemfunctioncall", "ResponsesOutputItemFunctionCallType": ".responsesoutputitemfunctioncall",
"ResponsesOutputItemFunctionCallTypedDict": ".responsesoutputitemfunctioncall", "ResponsesOutputItemFunctionCallTypedDict": ".responsesoutputitemfunctioncall",
"ResponsesOutputItemReasoning": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoning": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningFormat": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusCompleted": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusCompleted": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusInProgress": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusInProgress": ".responsesoutputitemreasoning",
"ResponsesOutputItemReasoningStatusIncomplete": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusIncomplete": ".responsesoutputitemreasoning",
@@ -2145,6 +2285,7 @@ _dynamic_imports: dict[str, str] = {
"ResponsesOutputMessageStatusUnionTypedDict": ".responsesoutputmessage", "ResponsesOutputMessageStatusUnionTypedDict": ".responsesoutputmessage",
"ResponsesOutputMessageType": ".responsesoutputmessage", "ResponsesOutputMessageType": ".responsesoutputmessage",
"ResponsesOutputMessageTypedDict": ".responsesoutputmessage", "ResponsesOutputMessageTypedDict": ".responsesoutputmessage",
"ResponsesOutputModality": ".responsesoutputmodality",
"ResponsesSearchContextSize": ".responsessearchcontextsize", "ResponsesSearchContextSize": ".responsessearchcontextsize",
"ResponsesWebSearchCallOutput": ".responseswebsearchcalloutput", "ResponsesWebSearchCallOutput": ".responseswebsearchcalloutput",
"ResponsesWebSearchCallOutputType": ".responseswebsearchcalloutput", "ResponsesWebSearchCallOutputType": ".responseswebsearchcalloutput",
+3 -2
View File
@@ -36,12 +36,12 @@ Schema0Enum = Union[
"Fireworks", "Fireworks",
"Friendli", "Friendli",
"GMICloud", "GMICloud",
"GoPomelo",
"Google", "Google",
"Google AI Studio", "Google AI Studio",
"Groq", "Groq",
"Hyperbolic", "Hyperbolic",
"Inception", "Inception",
"Inceptron",
"InferenceNet", "InferenceNet",
"Infermatic", "Infermatic",
"Inflection", "Inflection",
@@ -66,13 +66,14 @@ Schema0Enum = Union[
"Phala", "Phala",
"Relace", "Relace",
"SambaNova", "SambaNova",
"Seed",
"SiliconFlow", "SiliconFlow",
"Sourceful", "Sourceful",
"Stealth", "Stealth",
"StreamLake", "StreamLake",
"Switchpoint", "Switchpoint",
"Targon",
"Together", "Together",
"Upstage",
"Venice", "Venice",
"WandB", "WandB",
"Xiaomi", "Xiaomi",
+1
View File
@@ -21,6 +21,7 @@ Schema5 = Union[
Literal[ Literal[
"unknown", "unknown",
"openai-responses-v1", "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",
+184 -14
View File
@@ -80,6 +80,124 @@ class ChatGenerationParamsMaxPrice(BaseModel):
request: Optional[Any] = None 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): class ChatGenerationParamsProviderTypedDict(TypedDict):
allow_fallbacks: NotRequired[Nullable[bool]] allow_fallbacks: NotRequired[Nullable[bool]]
r"""Whether to allow backup providers to serve requests 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.""" 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] 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.""" 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_min_throughput: NotRequired[
preferred_max_latency: NotRequired[Nullable[float]] Nullable[ChatGenerationParamsPreferredMinThroughputUnionTypedDict]
min_throughput: NotRequired[Nullable[float]] ]
max_latency: NotRequired[Nullable[float]] 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): class ChatGenerationParamsProvider(BaseModel):
@@ -160,13 +282,15 @@ class ChatGenerationParamsProvider(BaseModel):
max_price: Optional[ChatGenerationParamsMaxPrice] = None 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.""" 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 preferred_max_latency: OptionalNullable[
ChatGenerationParamsPreferredMaxLatencyUnion
min_throughput: OptionalNullable[float] = UNSET ] = 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."""
max_latency: OptionalNullable[float] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
@@ -184,8 +308,6 @@ class ChatGenerationParamsProvider(BaseModel):
"max_price", "max_price",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
nullable_fields = [ nullable_fields = [
"allow_fallbacks", "allow_fallbacks",
@@ -200,8 +322,6 @@ class ChatGenerationParamsProvider(BaseModel):
"sort", "sort",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
null_default_fields = [] null_default_fields = []
@@ -331,11 +451,31 @@ class ChatGenerationParamsPluginModeration(BaseModel):
] = "moderation" ] = "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 = TypeAliasType(
"ChatGenerationParamsPluginUnionTypedDict", "ChatGenerationParamsPluginUnionTypedDict",
Union[ Union[
ChatGenerationParamsPluginModerationTypedDict, ChatGenerationParamsPluginModerationTypedDict,
ChatGenerationParamsPluginResponseHealingTypedDict, ChatGenerationParamsPluginResponseHealingTypedDict,
ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginWebTypedDict, ChatGenerationParamsPluginWebTypedDict,
], ],
@@ -344,6 +484,7 @@ ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
ChatGenerationParamsPluginUnion = Annotated[ ChatGenerationParamsPluginUnion = Annotated[
Union[ Union[
Annotated[ChatGenerationParamsPluginAutoRouter, Tag("auto-router")],
Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")], Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")],
Annotated[ChatGenerationParamsPluginWeb, Tag("web")], Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")], Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
@@ -498,6 +639,25 @@ class Debug(BaseModel):
echo_upstream_body: Optional[bool] = None 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): class ChatGenerationParamsTypedDict(TypedDict):
messages: List[MessageTypedDict] messages: List[MessageTypedDict]
provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]] provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]]
@@ -529,6 +689,8 @@ class ChatGenerationParamsTypedDict(TypedDict):
tools: NotRequired[List[ToolDefinitionJSONTypedDict]] tools: NotRequired[List[ToolDefinitionJSONTypedDict]]
top_p: NotRequired[Nullable[float]] top_p: NotRequired[Nullable[float]]
debug: NotRequired[DebugTypedDict] debug: NotRequired[DebugTypedDict]
image_config: NotRequired[Dict[str, ChatGenerationParamsImageConfigTypedDict]]
modalities: NotRequired[List[Modality]]
class ChatGenerationParams(BaseModel): class ChatGenerationParams(BaseModel):
@@ -591,6 +753,12 @@ class ChatGenerationParams(BaseModel):
debug: Optional[Debug] = None 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") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = [
@@ -620,6 +788,8 @@ class ChatGenerationParams(BaseModel):
"tools", "tools",
"top_p", "top_p",
"debug", "debug",
"image_config",
"modalities",
] ]
nullable_fields = [ nullable_fields = [
"provider", "provider",
@@ -72,6 +72,7 @@ class CompletionTokensDetails(BaseModel):
class PromptTokensDetailsTypedDict(TypedDict): class PromptTokensDetailsTypedDict(TypedDict):
cached_tokens: NotRequired[float] cached_tokens: NotRequired[float]
cache_write_tokens: NotRequired[float]
audio_tokens: NotRequired[float] audio_tokens: NotRequired[float]
video_tokens: NotRequired[float] video_tokens: NotRequired[float]
@@ -79,6 +80,8 @@ class PromptTokensDetailsTypedDict(TypedDict):
class PromptTokensDetails(BaseModel): class PromptTokensDetails(BaseModel):
cached_tokens: Optional[float] = None cached_tokens: Optional[float] = None
cache_write_tokens: Optional[float] = None
audio_tokens: Optional[float] = None audio_tokens: Optional[float] = None
video_tokens: Optional[float] = None video_tokens: Optional[float] = None
@@ -8,13 +8,13 @@ from typing import List
from typing_extensions import Annotated, TypedDict from typing_extensions import Annotated, TypedDict
class TopLogprobTypedDict(TypedDict): class ChatMessageTokenLogprobTopLogprobTypedDict(TypedDict):
token: str token: str
logprob: float logprob: float
bytes_: Nullable[List[float]] bytes_: Nullable[List[float]]
class TopLogprob(BaseModel): class ChatMessageTokenLogprobTopLogprob(BaseModel):
token: str token: str
logprob: float logprob: float
@@ -56,7 +56,7 @@ class ChatMessageTokenLogprobTypedDict(TypedDict):
token: str token: str
logprob: float logprob: float
bytes_: Nullable[List[float]] bytes_: Nullable[List[float]]
top_logprobs: List[TopLogprobTypedDict] top_logprobs: List[ChatMessageTokenLogprobTopLogprobTypedDict]
class ChatMessageTokenLogprob(BaseModel): class ChatMessageTokenLogprob(BaseModel):
@@ -66,7 +66,7 @@ class ChatMessageTokenLogprob(BaseModel):
bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")] bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
top_logprobs: List[TopLogprob] top_logprobs: List[ChatMessageTokenLogprobTopLogprob]
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
@@ -3,16 +3,24 @@
from __future__ import annotations from __future__ import annotations
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
from openrouter.types import BaseModel from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
from openrouter.utils import get_discriminator from openrouter.types import (
from pydantic import Discriminator, Tag 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 import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
OpenResponsesEasyInputMessageType = Literal["message",] OpenResponsesEasyInputMessageTypeMessage = Literal["message",]
OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",] OpenResponsesEasyInputMessageRoleDeveloper = Literal["developer",]
@@ -49,49 +57,114 @@ OpenResponsesEasyInputMessageRoleUnion = TypeAliasType(
) )
OpenResponsesEasyInputMessageContent1TypedDict = TypeAliasType( OpenResponsesEasyInputMessageContentType = Literal["input_image",]
"OpenResponsesEasyInputMessageContent1TypedDict",
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[ Union[
ResponseInputTextTypedDict, ResponseInputTextTypedDict,
ResponseInputAudioTypedDict, ResponseInputAudioTypedDict,
ResponseInputImageTypedDict, ResponseInputVideoTypedDict,
OpenResponsesEasyInputMessageContentInputImageTypedDict,
ResponseInputFileTypedDict, ResponseInputFileTypedDict,
], ],
) )
OpenResponsesEasyInputMessageContent1 = Annotated[ OpenResponsesEasyInputMessageContentUnion1 = Annotated[
Union[ Union[
Annotated[ResponseInputText, Tag("input_text")], Annotated[ResponseInputText, Tag("input_text")],
Annotated[ResponseInputImage, Tag("input_image")], Annotated[OpenResponsesEasyInputMessageContentInputImage, Tag("input_image")],
Annotated[ResponseInputFile, Tag("input_file")], Annotated[ResponseInputFile, Tag("input_file")],
Annotated[ResponseInputAudio, Tag("input_audio")], Annotated[ResponseInputAudio, Tag("input_audio")],
Annotated[ResponseInputVideo, Tag("input_video")],
], ],
Discriminator(lambda m: get_discriminator(m, "type", "type")), Discriminator(lambda m: get_discriminator(m, "type", "type")),
] ]
OpenResponsesEasyInputMessageContent2TypedDict = TypeAliasType( OpenResponsesEasyInputMessageContentUnion2TypedDict = TypeAliasType(
"OpenResponsesEasyInputMessageContent2TypedDict", "OpenResponsesEasyInputMessageContentUnion2TypedDict",
Union[List[OpenResponsesEasyInputMessageContent1TypedDict], str], Union[List[OpenResponsesEasyInputMessageContentUnion1TypedDict], str],
) )
OpenResponsesEasyInputMessageContent2 = TypeAliasType( OpenResponsesEasyInputMessageContentUnion2 = TypeAliasType(
"OpenResponsesEasyInputMessageContent2", "OpenResponsesEasyInputMessageContentUnion2",
Union[List[OpenResponsesEasyInputMessageContent1], str], Union[List[OpenResponsesEasyInputMessageContentUnion1], str],
) )
class OpenResponsesEasyInputMessageTypedDict(TypedDict): class OpenResponsesEasyInputMessageTypedDict(TypedDict):
role: OpenResponsesEasyInputMessageRoleUnionTypedDict role: OpenResponsesEasyInputMessageRoleUnionTypedDict
content: OpenResponsesEasyInputMessageContent2TypedDict content: OpenResponsesEasyInputMessageContentUnion2TypedDict
type: NotRequired[OpenResponsesEasyInputMessageType] type: NotRequired[OpenResponsesEasyInputMessageTypeMessage]
class OpenResponsesEasyInputMessage(BaseModel): class OpenResponsesEasyInputMessage(BaseModel):
role: OpenResponsesEasyInputMessageRoleUnion role: OpenResponsesEasyInputMessageRoleUnion
content: OpenResponsesEasyInputMessageContent2 content: OpenResponsesEasyInputMessageContentUnion2
type: Optional[OpenResponsesEasyInputMessageType] = None type: Optional[OpenResponsesEasyInputMessageTypeMessage] = None
@@ -60,9 +60,9 @@ OpenResponsesInput1TypedDict = TypeAliasType(
OpenResponsesFunctionCallOutputTypedDict, OpenResponsesFunctionCallOutputTypedDict,
ResponsesOutputMessageTypedDict, ResponsesOutputMessageTypedDict,
OpenResponsesFunctionToolCallTypedDict, OpenResponsesFunctionToolCallTypedDict,
ResponsesOutputItemReasoningTypedDict,
ResponsesOutputItemFunctionCallTypedDict, ResponsesOutputItemFunctionCallTypedDict,
OpenResponsesReasoningTypedDict, OpenResponsesReasoningTypedDict,
ResponsesOutputItemReasoningTypedDict,
], ],
) )
@@ -78,9 +78,9 @@ OpenResponsesInput1 = TypeAliasType(
OpenResponsesFunctionCallOutput, OpenResponsesFunctionCallOutput,
ResponsesOutputMessage, ResponsesOutputMessage,
OpenResponsesFunctionToolCall, OpenResponsesFunctionToolCall,
ResponsesOutputItemReasoning,
ResponsesOutputItemFunctionCall, ResponsesOutputItemFunctionCall,
OpenResponsesReasoning, OpenResponsesReasoning,
ResponsesOutputItemReasoning,
], ],
) )
@@ -3,16 +3,24 @@
from __future__ import annotations from __future__ import annotations
from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict from .responseinputaudio import ResponseInputAudio, ResponseInputAudioTypedDict
from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict from .responseinputfile import ResponseInputFile, ResponseInputFileTypedDict
from .responseinputimage import ResponseInputImage, ResponseInputImageTypedDict
from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict from .responseinputtext import ResponseInputText, ResponseInputTextTypedDict
from openrouter.types import BaseModel from .responseinputvideo import ResponseInputVideo, ResponseInputVideoTypedDict
from openrouter.utils import get_discriminator from openrouter.types import (
from pydantic import Discriminator, Tag 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 import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
OpenResponsesInputMessageItemType = Literal["message",] OpenResponsesInputMessageItemTypeMessage = Literal["message",]
OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",] OpenResponsesInputMessageItemRoleDeveloper = Literal["developer",]
@@ -44,23 +52,88 @@ OpenResponsesInputMessageItemRoleUnion = TypeAliasType(
) )
OpenResponsesInputMessageItemContentTypedDict = TypeAliasType( OpenResponsesInputMessageItemContentType = Literal["input_image",]
"OpenResponsesInputMessageItemContentTypedDict",
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[ Union[
ResponseInputTextTypedDict, ResponseInputTextTypedDict,
ResponseInputAudioTypedDict, ResponseInputAudioTypedDict,
ResponseInputImageTypedDict, ResponseInputVideoTypedDict,
OpenResponsesInputMessageItemContentInputImageTypedDict,
ResponseInputFileTypedDict, ResponseInputFileTypedDict,
], ],
) )
OpenResponsesInputMessageItemContent = Annotated[ OpenResponsesInputMessageItemContentUnion = Annotated[
Union[ Union[
Annotated[ResponseInputText, Tag("input_text")], Annotated[ResponseInputText, Tag("input_text")],
Annotated[ResponseInputImage, Tag("input_image")], Annotated[OpenResponsesInputMessageItemContentInputImage, Tag("input_image")],
Annotated[ResponseInputFile, Tag("input_file")], Annotated[ResponseInputFile, Tag("input_file")],
Annotated[ResponseInputAudio, Tag("input_audio")], Annotated[ResponseInputAudio, Tag("input_audio")],
Annotated[ResponseInputVideo, Tag("input_video")],
], ],
Discriminator(lambda m: get_discriminator(m, "type", "type")), Discriminator(lambda m: get_discriminator(m, "type", "type")),
] ]
@@ -68,16 +141,16 @@ OpenResponsesInputMessageItemContent = Annotated[
class OpenResponsesInputMessageItemTypedDict(TypedDict): class OpenResponsesInputMessageItemTypedDict(TypedDict):
role: OpenResponsesInputMessageItemRoleUnionTypedDict role: OpenResponsesInputMessageItemRoleUnionTypedDict
content: List[OpenResponsesInputMessageItemContentTypedDict] content: List[OpenResponsesInputMessageItemContentUnionTypedDict]
id: NotRequired[str] id: NotRequired[str]
type: NotRequired[OpenResponsesInputMessageItemType] type: NotRequired[OpenResponsesInputMessageItemTypeMessage]
class OpenResponsesInputMessageItem(BaseModel): class OpenResponsesInputMessageItem(BaseModel):
role: OpenResponsesInputMessageItemRoleUnion role: OpenResponsesInputMessageItemRoleUnion
content: List[OpenResponsesInputMessageItemContent] content: List[OpenResponsesInputMessageItemContentUnion]
id: Optional[str] = None id: Optional[str] = None
type: Optional[OpenResponsesInputMessageItemType] = None type: Optional[OpenResponsesInputMessageItemTypeMessage] = None
@@ -149,24 +149,27 @@ class OpenResponsesNonStreamingResponseTypedDict(TypedDict):
object: Object object: Object
created_at: float created_at: float
model: str model: str
status: OpenAIResponsesResponseStatus
completed_at: Nullable[float]
output: List[ResponsesOutputItemTypedDict] output: List[ResponsesOutputItemTypedDict]
error: Nullable[ResponsesErrorFieldTypedDict] error: Nullable[ResponsesErrorFieldTypedDict]
r"""Error information returned from the API""" r"""Error information returned from the API"""
incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict] incomplete_details: Nullable[OpenAIResponsesIncompleteDetailsTypedDict]
temperature: Nullable[float] temperature: Nullable[float]
top_p: Nullable[float] top_p: Nullable[float]
presence_penalty: Nullable[float]
frequency_penalty: Nullable[float]
instructions: Nullable[OpenAIResponsesInputUnionTypedDict] instructions: Nullable[OpenAIResponsesInputUnionTypedDict]
metadata: Nullable[Dict[str, str]] 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.""" 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] tools: List[OpenResponsesNonStreamingResponseToolUnionTypedDict]
tool_choice: OpenAIResponsesToolChoiceUnionTypedDict tool_choice: OpenAIResponsesToolChoiceUnionTypedDict
parallel_tool_calls: bool parallel_tool_calls: bool
status: NotRequired[OpenAIResponsesResponseStatus]
user: NotRequired[Nullable[str]] user: NotRequired[Nullable[str]]
output_text: NotRequired[str] output_text: NotRequired[str]
prompt_cache_key: NotRequired[Nullable[str]] prompt_cache_key: NotRequired[Nullable[str]]
safety_identifier: NotRequired[Nullable[str]] safety_identifier: NotRequired[Nullable[str]]
usage: NotRequired[OpenResponsesUsageTypedDict] usage: NotRequired[Nullable[OpenResponsesUsageTypedDict]]
r"""Token usage information for the response""" r"""Token usage information for the response"""
max_tool_calls: NotRequired[Nullable[float]] max_tool_calls: NotRequired[Nullable[float]]
top_logprobs: NotRequired[float] top_logprobs: NotRequired[float]
@@ -193,6 +196,12 @@ class OpenResponsesNonStreamingResponse(BaseModel):
model: str model: str
status: Annotated[
OpenAIResponsesResponseStatus, PlainValidator(validate_open_enum(False))
]
completed_at: Nullable[float]
output: List[ResponsesOutputItem] output: List[ResponsesOutputItem]
error: Nullable[ResponsesErrorField] error: Nullable[ResponsesErrorField]
@@ -204,6 +213,10 @@ class OpenResponsesNonStreamingResponse(BaseModel):
top_p: Nullable[float] top_p: Nullable[float]
presence_penalty: Nullable[float]
frequency_penalty: Nullable[float]
instructions: Nullable[OpenAIResponsesInputUnion] instructions: Nullable[OpenAIResponsesInputUnion]
metadata: Nullable[Dict[str, str]] metadata: Nullable[Dict[str, str]]
@@ -215,11 +228,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
parallel_tool_calls: bool parallel_tool_calls: bool
status: Annotated[
Optional[OpenAIResponsesResponseStatus],
PlainValidator(validate_open_enum(False)),
] = None
user: OptionalNullable[str] = UNSET user: OptionalNullable[str] = UNSET
output_text: Optional[str] = None output_text: Optional[str] = None
@@ -228,7 +236,7 @@ class OpenResponsesNonStreamingResponse(BaseModel):
safety_identifier: OptionalNullable[str] = UNSET safety_identifier: OptionalNullable[str] = UNSET
usage: Optional[OpenResponsesUsage] = None usage: OptionalNullable[OpenResponsesUsage] = UNSET
r"""Token usage information for the response""" r"""Token usage information for the response"""
max_tool_calls: OptionalNullable[float] = UNSET max_tool_calls: OptionalNullable[float] = UNSET
@@ -263,7 +271,6 @@ class OpenResponsesNonStreamingResponse(BaseModel):
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = [
"status",
"user", "user",
"output_text", "output_text",
"prompt_cache_key", "prompt_cache_key",
@@ -282,15 +289,19 @@ class OpenResponsesNonStreamingResponse(BaseModel):
"text", "text",
] ]
nullable_fields = [ nullable_fields = [
"completed_at",
"user", "user",
"prompt_cache_key", "prompt_cache_key",
"safety_identifier", "safety_identifier",
"error", "error",
"incomplete_details", "incomplete_details",
"usage",
"max_tool_calls", "max_tool_calls",
"max_output_tokens", "max_output_tokens",
"temperature", "temperature",
"top_p", "top_p",
"presence_penalty",
"frequency_penalty",
"instructions", "instructions",
"metadata", "metadata",
"prompt", "prompt",
@@ -55,6 +55,7 @@ OpenResponsesReasoningFormat = Union[
Literal[ Literal[
"unknown", "unknown",
"openai-responses-v1", "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",
@@ -34,10 +34,16 @@ from .openresponseswebsearchtool import (
OpenResponsesWebSearchToolTypedDict, OpenResponsesWebSearchToolTypedDict,
) )
from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName from .providername import ProviderName
from .providersort import ProviderSort from .providersort import ProviderSort
from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict
from .quantization import Quantization from .quantization import Quantization
from .responsesoutputmodality import ResponsesOutputModality
from .websearchengine import WebSearchEngine from .websearchengine import WebSearchEngine
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
@@ -139,6 +145,16 @@ OpenResponsesRequestToolUnion = Annotated[
] ]
OpenResponsesRequestImageConfigTypedDict = TypeAliasType(
"OpenResponsesRequestImageConfigTypedDict", Union[str, float]
)
OpenResponsesRequestImageConfig = TypeAliasType(
"OpenResponsesRequestImageConfig", Union[str, float]
)
ServiceTier = Literal["auto",] 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.""" 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] 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.""" 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_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]]
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.""" 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[float]] preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]]
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.""" 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."""
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."""
class OpenResponsesRequestProvider(BaseModel): class OpenResponsesRequestProvider(BaseModel):
@@ -327,27 +339,11 @@ class OpenResponsesRequestProvider(BaseModel):
max_price: Optional[OpenResponsesRequestMaxPrice] = None 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.""" 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[PreferredMinThroughput] = 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.""" 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 preferred_max_latency: OptionalNullable[PreferredMaxLatency] = 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.""" 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."""
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."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
@@ -365,8 +361,6 @@ class OpenResponsesRequestProvider(BaseModel):
"max_price", "max_price",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
nullable_fields = [ nullable_fields = [
"allow_fallbacks", "allow_fallbacks",
@@ -381,8 +375,6 @@ class OpenResponsesRequestProvider(BaseModel):
"sort", "sort",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
null_default_fields = [] null_default_fields = []
@@ -488,11 +480,33 @@ class OpenResponsesRequestPluginModeration(BaseModel):
id: IDModeration 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 = TypeAliasType(
"OpenResponsesRequestPluginUnionTypedDict", "OpenResponsesRequestPluginUnionTypedDict",
Union[ Union[
OpenResponsesRequestPluginModerationTypedDict, OpenResponsesRequestPluginModerationTypedDict,
OpenResponsesRequestPluginResponseHealingTypedDict, OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginWebTypedDict, OpenResponsesRequestPluginWebTypedDict,
], ],
@@ -501,6 +515,7 @@ OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
OpenResponsesRequestPluginUnion = Annotated[ OpenResponsesRequestPluginUnion = Annotated[
Union[ Union[
Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")],
Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")], Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")],
Annotated[OpenResponsesRequestPluginWeb, Tag("web")], Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")], Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
@@ -530,7 +545,15 @@ class OpenResponsesRequestTypedDict(TypedDict):
max_output_tokens: NotRequired[Nullable[float]] max_output_tokens: NotRequired[Nullable[float]]
temperature: NotRequired[Nullable[float]] temperature: NotRequired[Nullable[float]]
top_p: 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] 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]] prompt_cache_key: NotRequired[Nullable[str]]
previous_response_id: NotRequired[Nullable[str]] previous_response_id: NotRequired[Nullable[str]]
prompt: NotRequired[Nullable[OpenAIResponsesPromptTypedDict]] prompt: NotRequired[Nullable[OpenAIResponsesPromptTypedDict]]
@@ -584,8 +607,28 @@ class OpenResponsesRequest(BaseModel):
top_p: 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 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 prompt_cache_key: OptionalNullable[str] = UNSET
previous_response_id: OptionalNullable[str] = UNSET previous_response_id: OptionalNullable[str] = UNSET
@@ -645,7 +688,13 @@ class OpenResponsesRequest(BaseModel):
"max_output_tokens", "max_output_tokens",
"temperature", "temperature",
"top_p", "top_p",
"top_logprobs",
"max_tool_calls",
"presence_penalty",
"frequency_penalty",
"top_k", "top_k",
"image_config",
"modalities",
"prompt_cache_key", "prompt_cache_key",
"previous_response_id", "previous_response_id",
"prompt", "prompt",
@@ -669,6 +718,10 @@ class OpenResponsesRequest(BaseModel):
"max_output_tokens", "max_output_tokens",
"temperature", "temperature",
"top_p", "top_p",
"top_logprobs",
"max_tool_calls",
"presence_penalty",
"frequency_penalty",
"prompt_cache_key", "prompt_cache_key",
"previous_response_id", "previous_response_id",
"prompt", "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", "Fireworks",
"Friendli", "Friendli",
"GMICloud", "GMICloud",
"GoPomelo",
"Google", "Google",
"Google AI Studio", "Google AI Studio",
"Groq", "Groq",
"Hyperbolic", "Hyperbolic",
"Inception", "Inception",
"Inceptron",
"InferenceNet", "InferenceNet",
"Infermatic", "Infermatic",
"Inflection", "Inflection",
@@ -63,13 +63,14 @@ ProviderName = Union[
"Phala", "Phala",
"Relace", "Relace",
"SambaNova", "SambaNova",
"Seed",
"SiliconFlow", "SiliconFlow",
"Sourceful", "Sourceful",
"Stealth", "Stealth",
"StreamLake", "StreamLake",
"Switchpoint", "Switchpoint",
"Targon",
"Together", "Together",
"Upstage",
"Venice", "Venice",
"WandB", "WandB",
"Xiaomi", "Xiaomi",
@@ -2,6 +2,11 @@
from __future__ import annotations from __future__ import annotations
from .datacollection import DataCollection from .datacollection import DataCollection
from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict
from .preferredminthroughput import (
PreferredMinThroughput,
PreferredMinThroughputTypedDict,
)
from .providername import ProviderName from .providername import ProviderName
from .providersort import ProviderSort from .providersort import ProviderSort
from .quantization import Quantization from .quantization import Quantization
@@ -14,7 +19,6 @@ from openrouter.types import (
UnrecognizedStr, UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
import pydantic
from pydantic import model_serializer from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union from typing import List, Literal, Optional, Union
@@ -234,14 +238,10 @@ class ProviderPreferencesTypedDict(TypedDict):
sort: NotRequired[Nullable[ProviderPreferencesSortUnionTypedDict]] sort: NotRequired[Nullable[ProviderPreferencesSortUnionTypedDict]]
max_price: NotRequired[ProviderPreferencesMaxPriceTypedDict] 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.""" 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_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]]
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.""" 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[float]] preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]]
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.""" 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."""
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."""
class ProviderPreferences(BaseModel): class ProviderPreferences(BaseModel):
@@ -291,27 +291,11 @@ class ProviderPreferences(BaseModel):
max_price: Optional[ProviderPreferencesMaxPrice] = None 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.""" 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[PreferredMinThroughput] = 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.""" 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 preferred_max_latency: OptionalNullable[PreferredMaxLatency] = 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.""" 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."""
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."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
@@ -329,8 +313,6 @@ class ProviderPreferences(BaseModel):
"max_price", "max_price",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
nullable_fields = [ nullable_fields = [
"allow_fallbacks", "allow_fallbacks",
@@ -345,8 +327,6 @@ class ProviderPreferences(BaseModel):
"sort", "sort",
"preferred_min_throughput", "preferred_min_throughput",
"preferred_max_latency", "preferred_max_latency",
"min_throughput",
"max_latency",
] ]
null_default_fields = [] null_default_fields = []
@@ -3,6 +3,7 @@
from __future__ import annotations from __future__ import annotations
from .endpointstatus import EndpointStatus from .endpointstatus import EndpointStatus
from .parameter import Parameter from .parameter import Parameter
from .percentilestats import PercentileStats, PercentileStatsTypedDict
from .providername import ProviderName from .providername import ProviderName
from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
@@ -111,6 +112,9 @@ class PublicEndpointTypedDict(TypedDict):
supported_parameters: List[Parameter] supported_parameters: List[Parameter]
uptime_last_30m: Nullable[float] uptime_last_30m: Nullable[float]
supports_implicit_caching: bool 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] status: NotRequired[EndpointStatus]
@@ -145,6 +149,11 @@ class PublicEndpoint(BaseModel):
supports_implicit_caching: bool 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[ status: Annotated[
Optional[EndpointStatus], PlainValidator(validate_open_enum(True)) Optional[EndpointStatus], PlainValidator(validate_open_enum(True))
] = None ] = None
@@ -157,6 +166,8 @@ class PublicEndpoint(BaseModel):
"max_completion_tokens", "max_completion_tokens",
"max_prompt_tokens", "max_prompt_tokens",
"uptime_last_30m", "uptime_last_30m",
"latency_last_30m",
"throughput_last_30m",
] ]
null_default_fields = [] 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, OpenAIResponsesAnnotationTypedDict,
) )
from openrouter.types import BaseModel from openrouter.types import BaseModel
import pydantic
from typing import List, Literal, Optional from typing import List, Literal, Optional
from typing_extensions import NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
ResponseOutputTextType = Literal["output_text",] 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): class ResponseOutputTextTypedDict(TypedDict):
type: ResponseOutputTextType type: ResponseOutputTextType
text: str text: str
annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]] annotations: NotRequired[List[OpenAIResponsesAnnotationTypedDict]]
logprobs: NotRequired[List[LogprobTypedDict]]
class ResponseOutputText(BaseModel): class ResponseOutputText(BaseModel):
@@ -25,3 +58,5 @@ class ResponseOutputText(BaseModel):
text: str text: str
annotations: Optional[List[OpenAIResponsesAnnotation]] = None annotations: Optional[List[OpenAIResponsesAnnotation]] = None
logprobs: Optional[List[Logprob]] = None
@@ -38,8 +38,8 @@ ResponsesOutputItemTypedDict = TypeAliasType(
ResponsesOutputItemFileSearchCallTypedDict, ResponsesOutputItemFileSearchCallTypedDict,
ResponsesImageGenerationCallTypedDict, ResponsesImageGenerationCallTypedDict,
ResponsesOutputMessageTypedDict, ResponsesOutputMessageTypedDict,
ResponsesOutputItemReasoningTypedDict,
ResponsesOutputItemFunctionCallTypedDict, ResponsesOutputItemFunctionCallTypedDict,
ResponsesOutputItemReasoningTypedDict,
], ],
) )
r"""An output item from the response""" r"""An output item from the response"""
@@ -9,10 +9,14 @@ from openrouter.types import (
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum
import pydantic
from pydantic import model_serializer from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union 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",] 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): class ResponsesOutputItemReasoningTypedDict(TypedDict):
r"""An output item containing reasoning""" r"""An output item containing reasoning"""
@@ -56,6 +74,10 @@ class ResponsesOutputItemReasoningTypedDict(TypedDict):
content: NotRequired[List[ReasoningTextContentTypedDict]] content: NotRequired[List[ReasoningTextContentTypedDict]]
encrypted_content: NotRequired[Nullable[str]] encrypted_content: NotRequired[Nullable[str]]
status: NotRequired[ResponsesOutputItemReasoningStatusUnionTypedDict] 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): class ResponsesOutputItemReasoning(BaseModel):
@@ -73,10 +95,28 @@ class ResponsesOutputItemReasoning(BaseModel):
status: Optional[ResponsesOutputItemReasoningStatusUnion] = None 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") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = ["content", "encrypted_content", "status"] optional_fields = [
nullable_fields = ["encrypted_content"] "content",
"encrypted_content",
"status",
"signature",
"format",
]
nullable_fields = ["encrypted_content", "signature", "format"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) 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""" r"""External user identifier"""
api_type: Nullable[APIType] api_type: Nullable[APIType]
r"""Type of API used for the generation""" r"""Type of API used for the generation"""
router: Nullable[str]
r"""Router used for the request (e.g., openrouter/auto)"""
class GetGenerationData(BaseModel): class GetGenerationData(BaseModel):
@@ -197,6 +199,9 @@ class GetGenerationData(BaseModel):
api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))] api_type: Annotated[Nullable[APIType], PlainValidator(validate_open_enum(False))]
r"""Type of API used for the generation""" 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") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [] optional_fields = []
@@ -226,6 +231,7 @@ class GetGenerationData(BaseModel):
"native_finish_reason", "native_finish_reason",
"external_user", "external_user",
"api_type", "api_type",
"router",
] ]
null_default_fields = [] null_default_fields = []
+114
View File
@@ -57,7 +57,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -108,7 +119,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -168,7 +185,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -219,7 +247,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -278,7 +312,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -329,7 +374,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -383,7 +434,13 @@ class Responses(BaseSDK):
max_output_tokens=max_output_tokens, max_output_tokens=max_output_tokens,
temperature=temperature, temperature=temperature,
top_p=top_p, 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, top_k=top_k,
image_config=image_config,
modalities=modalities,
prompt_cache_key=prompt_cache_key, prompt_cache_key=prompt_cache_key,
previous_response_id=previous_response_id, previous_response_id=previous_response_id,
prompt=utils.get_pydantic_model( prompt=utils.get_pydantic_model(
@@ -633,7 +690,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -684,7 +752,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -744,7 +818,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -795,7 +880,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -854,7 +945,18 @@ class Responses(BaseSDK):
max_output_tokens: OptionalNullable[float] = UNSET, max_output_tokens: OptionalNullable[float] = UNSET,
temperature: OptionalNullable[float] = UNSET, temperature: OptionalNullable[float] = UNSET,
top_p: 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, 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, prompt_cache_key: OptionalNullable[str] = UNSET,
previous_response_id: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET,
prompt: OptionalNullable[ prompt: OptionalNullable[
@@ -905,7 +1007,13 @@ class Responses(BaseSDK):
:param max_output_tokens: :param max_output_tokens:
:param temperature: :param temperature:
:param top_p: :param top_p:
:param top_logprobs:
:param max_tool_calls:
:param presence_penalty:
:param frequency_penalty:
:param top_k: :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 prompt_cache_key:
:param previous_response_id: :param previous_response_id:
:param prompt: :param prompt:
@@ -959,7 +1067,13 @@ class Responses(BaseSDK):
max_output_tokens=max_output_tokens, max_output_tokens=max_output_tokens,
temperature=temperature, temperature=temperature,
top_p=top_p, 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, top_k=top_k,
image_config=image_config,
modalities=modalities,
prompt_cache_key=prompt_cache_key, prompt_cache_key=prompt_cache_key,
previous_response_id=previous_response_id, previous_response_id=previous_response_id,
prompt=utils.get_pydantic_model( prompt=utils.get_pydantic_model(