Compare commits

..
1 Commits
Author SHA1 Message Date
OpenRouter Team 7b8f5941c8 Commits included in this export:
- 50539a3577b5a7e925b756f6bb87744052701215
  - 2cdbe64441ce4435ea0a1ff9127472e815fdaccf
  - f35bb49a8b788937fa61c0cf4591b14f2bc8b217
  - 08a37babde9ad8df5e24e0cd865d3292b1627464
  - 7ddc8e1ed230ca489bc11a5e14696c209ea76349
  - ad31290f38f3f02627f3e1953f1d7cf3e06159a5
  - fb7f764b500618e322f56d49997fbcfaebba7e39
  - 4306c032b9b4f3cfefeacdd3d243b0336f3b2f15

GitOrigin-RevId: 50539a3577b5a7e925b756f6bb87744052701215
2026-03-12 15:49:53 +00:00
100 changed files with 245 additions and 3498 deletions
+4 -63
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: fff8b3c28663df858db3a222b1f62d40 docChecksum: 74d4d2140677e899c1489f39198ea464
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.9.0 releaseVersion: 0.8.0
configChecksum: e6f61aeb6e1587fb2f6f67ef3b5217c5 configChecksum: fd866e0d9d3fef2d1d0ef2a52689a406
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
@@ -74,7 +74,6 @@ generatedFiles:
- docs/components/chatgenerationparams.md - docs/components/chatgenerationparams.md
- docs/components/chatgenerationparamsby.md - docs/components/chatgenerationparamsby.md
- docs/components/chatgenerationparamsidautorouter.md - docs/components/chatgenerationparamsidautorouter.md
- docs/components/chatgenerationparamsidcontextcompression.md
- docs/components/chatgenerationparamsidfileparser.md - docs/components/chatgenerationparamsidfileparser.md
- docs/components/chatgenerationparamsidmoderation.md - docs/components/chatgenerationparamsidmoderation.md
- docs/components/chatgenerationparamsidresponsehealing.md - docs/components/chatgenerationparamsidresponsehealing.md
@@ -86,7 +85,6 @@ generatedFiles:
- docs/components/chatgenerationparamsorder.md - docs/components/chatgenerationparamsorder.md
- docs/components/chatgenerationparamspartition.md - docs/components/chatgenerationparamspartition.md
- docs/components/chatgenerationparamspluginautorouter.md - docs/components/chatgenerationparamspluginautorouter.md
- docs/components/chatgenerationparamsplugincontextcompression.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
@@ -145,19 +143,14 @@ generatedFiles:
- docs/components/completiontokensdetails.md - docs/components/completiontokensdetails.md
- docs/components/compoundfilter.md - docs/components/compoundfilter.md
- docs/components/compoundfiltertype.md - docs/components/compoundfiltertype.md
- docs/components/conflictresponseerrordata.md
- docs/components/connectorid.md - docs/components/connectorid.md
- docs/components/container.md - docs/components/container.md
- docs/components/containerauto.md - docs/components/containerauto.md
- docs/components/containertype.md - docs/components/containertype.md
- docs/components/contextcompressionengine.md
- docs/components/costdetails.md - docs/components/costdetails.md
- docs/components/createchargerequest.md - docs/components/createchargerequest.md
- docs/components/data.md - docs/components/data.md
- docs/components/datacollection.md - docs/components/datacollection.md
- docs/components/datetimeservertool.md
- docs/components/datetimeservertoolparameters.md
- docs/components/datetimeservertooltype.md
- docs/components/debugoptions.md - docs/components/debugoptions.md
- docs/components/defaultparameters.md - docs/components/defaultparameters.md
- docs/components/developermessage.md - docs/components/developermessage.md
@@ -357,7 +350,6 @@ generatedFiles:
- docs/components/openresponsesreasoningtype.md - docs/components/openresponsesreasoningtype.md
- docs/components/openresponsesrequest.md - docs/components/openresponsesrequest.md
- docs/components/openresponsesrequestidautorouter.md - docs/components/openresponsesrequestidautorouter.md
- docs/components/openresponsesrequestidcontextcompression.md
- docs/components/openresponsesrequestidfileparser.md - docs/components/openresponsesrequestidfileparser.md
- docs/components/openresponsesrequestidmoderation.md - docs/components/openresponsesrequestidmoderation.md
- docs/components/openresponsesrequestidresponsehealing.md - docs/components/openresponsesrequestidresponsehealing.md
@@ -368,7 +360,6 @@ generatedFiles:
- docs/components/openresponsesrequestonly.md - docs/components/openresponsesrequestonly.md
- docs/components/openresponsesrequestorder.md - docs/components/openresponsesrequestorder.md
- docs/components/openresponsesrequestpluginautorouter.md - docs/components/openresponsesrequestpluginautorouter.md
- docs/components/openresponsesrequestplugincontextcompression.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
@@ -406,25 +397,13 @@ generatedFiles:
- docs/components/openresponsesstreameventtoplogprob2.md - docs/components/openresponsesstreameventtoplogprob2.md
- docs/components/openresponsesusage.md - docs/components/openresponsesusage.md
- docs/components/openresponseswebsearch20250826tool.md - docs/components/openresponseswebsearch20250826tool.md
- docs/components/openresponseswebsearch20250826toolengine.md
- docs/components/openresponseswebsearch20250826toolfilters.md - docs/components/openresponseswebsearch20250826toolfilters.md
- docs/components/openresponseswebsearch20250826tooltype.md - docs/components/openresponseswebsearch20250826tooltype.md
- docs/components/openresponseswebsearchcallcompleted.md
- docs/components/openresponseswebsearchcallcompletedtype.md
- docs/components/openresponseswebsearchcallinprogress.md
- docs/components/openresponseswebsearchcallinprogresstype.md
- docs/components/openresponseswebsearchcallsearching.md
- docs/components/openresponseswebsearchcallsearchingtype.md
- docs/components/openresponseswebsearchpreview20250311tool.md - docs/components/openresponseswebsearchpreview20250311tool.md
- docs/components/openresponseswebsearchpreview20250311toolengine.md
- docs/components/openresponseswebsearchpreview20250311toolfilters.md
- docs/components/openresponseswebsearchpreview20250311tooltype.md - docs/components/openresponseswebsearchpreview20250311tooltype.md
- docs/components/openresponseswebsearchpreviewtool.md - docs/components/openresponseswebsearchpreviewtool.md
- docs/components/openresponseswebsearchpreviewtoolengine.md
- docs/components/openresponseswebsearchpreviewtoolfilters.md
- docs/components/openresponseswebsearchpreviewtooltype.md - docs/components/openresponseswebsearchpreviewtooltype.md
- docs/components/openresponseswebsearchtool.md - docs/components/openresponseswebsearchtool.md
- docs/components/openresponseswebsearchtoolengine.md
- docs/components/openresponseswebsearchtoolfilters.md - docs/components/openresponseswebsearchtoolfilters.md
- docs/components/openresponseswebsearchtooltype.md - docs/components/openresponseswebsearchtooltype.md
- docs/components/outputformat.md - docs/components/outputformat.md
@@ -571,12 +550,7 @@ generatedFiles:
- docs/components/responsesoutputmessagetype.md - docs/components/responsesoutputmessagetype.md
- docs/components/responsesoutputmodality.md - docs/components/responsesoutputmodality.md
- docs/components/responsessearchcontextsize.md - docs/components/responsessearchcontextsize.md
- docs/components/responsesservertooloutput.md
- docs/components/responsesservertooloutputstatus.md
- docs/components/responseswebsearchcalloutput.md - docs/components/responseswebsearchcalloutput.md
- docs/components/responseswebsearchservertool.md
- docs/components/responseswebsearchservertoolparameters.md
- docs/components/responseswebsearchservertooltype.md
- docs/components/responseswebsearchuserlocation.md - docs/components/responseswebsearchuserlocation.md
- docs/components/responseswebsearchuserlocationtype.md - docs/components/responseswebsearchuserlocationtype.md
- docs/components/responsetextconfig.md - docs/components/responsetextconfig.md
@@ -599,7 +573,6 @@ generatedFiles:
- docs/components/toolchoiceoptionrequired.md - docs/components/toolchoiceoptionrequired.md
- docs/components/tooldefinitionjson.md - docs/components/tooldefinitionjson.md
- docs/components/tooldefinitionjsonfunction.md - docs/components/tooldefinitionjsonfunction.md
- docs/components/tooldefinitionjsonfunctionfunction.md
- docs/components/tooldefinitionjsontype.md - docs/components/tooldefinitionjsontype.md
- docs/components/toolresponsemessage.md - docs/components/toolresponsemessage.md
- docs/components/toolresponsemessagecontent.md - docs/components/toolresponsemessagecontent.md
@@ -647,28 +620,9 @@ generatedFiles:
- docs/components/websearchengine.md - docs/components/websearchengine.md
- docs/components/websearchpreviewtooluserlocation.md - docs/components/websearchpreviewtooluserlocation.md
- docs/components/websearchpreviewtooluserlocationtype.md - docs/components/websearchpreviewtooluserlocationtype.md
- docs/components/websearchservertool.md
- docs/components/websearchservertoolengine.md
- docs/components/websearchservertoolparameters.md
- docs/components/websearchservertoolparameterstype.md
- docs/components/websearchservertoolsearchcontextsize.md
- docs/components/websearchservertooltypeopenrouterwebsearch.md
- docs/components/websearchservertooluserlocation.md
- docs/components/websearchshorthand.md
- docs/components/websearchshorthandengine.md
- docs/components/websearchshorthandparameters.md
- docs/components/websearchshorthandparametersengine.md
- docs/components/websearchshorthandparameterssearchcontextsize.md
- docs/components/websearchshorthandparameterstype.md
- docs/components/websearchshorthandparametersuserlocation.md
- docs/components/websearchshorthandsearchcontextsize.md
- docs/components/websearchshorthandtype.md
- docs/components/websearchshorthandtypeapproximate.md
- docs/components/websearchshorthanduserlocation.md
- docs/components/websearchstatus.md - docs/components/websearchstatus.md
- docs/errors/badgatewayresponseerror.md - docs/errors/badgatewayresponseerror.md
- docs/errors/badrequestresponseerror.md - docs/errors/badrequestresponseerror.md
- docs/errors/conflictresponseerror.md
- docs/errors/edgenetworktimeoutresponseerror.md - docs/errors/edgenetworktimeoutresponseerror.md
- docs/errors/forbiddenresponseerror.md - docs/errors/forbiddenresponseerror.md
- docs/errors/internalserverresponseerror.md - docs/errors/internalserverresponseerror.md
@@ -907,11 +861,8 @@ generatedFiles:
- src/openrouter/components/chatstreamingresponsechunk.py - src/openrouter/components/chatstreamingresponsechunk.py
- src/openrouter/components/chatstreamoptions.py - src/openrouter/components/chatstreamoptions.py
- src/openrouter/components/compoundfilter.py - src/openrouter/components/compoundfilter.py
- src/openrouter/components/conflictresponseerrordata.py
- src/openrouter/components/contextcompressionengine.py
- src/openrouter/components/createchargerequest.py - src/openrouter/components/createchargerequest.py
- src/openrouter/components/datacollection.py - src/openrouter/components/datacollection.py
- src/openrouter/components/datetimeservertool.py
- src/openrouter/components/debugoptions.py - src/openrouter/components/debugoptions.py
- src/openrouter/components/defaultparameters.py - src/openrouter/components/defaultparameters.py
- src/openrouter/components/developermessage.py - src/openrouter/components/developermessage.py
@@ -978,9 +929,6 @@ generatedFiles:
- src/openrouter/components/openresponsesstreamevent.py - src/openrouter/components/openresponsesstreamevent.py
- src/openrouter/components/openresponsesusage.py - src/openrouter/components/openresponsesusage.py
- src/openrouter/components/openresponseswebsearch20250826tool.py - src/openrouter/components/openresponseswebsearch20250826tool.py
- src/openrouter/components/openresponseswebsearchcallcompleted.py
- src/openrouter/components/openresponseswebsearchcallinprogress.py
- src/openrouter/components/openresponseswebsearchcallsearching.py
- src/openrouter/components/openresponseswebsearchpreview20250311tool.py - src/openrouter/components/openresponseswebsearchpreview20250311tool.py
- src/openrouter/components/openresponseswebsearchpreviewtool.py - src/openrouter/components/openresponseswebsearchpreviewtool.py
- src/openrouter/components/openresponseswebsearchtool.py - src/openrouter/components/openresponseswebsearchtool.py
@@ -1037,9 +985,7 @@ generatedFiles:
- src/openrouter/components/responsesoutputmessage.py - src/openrouter/components/responsesoutputmessage.py
- src/openrouter/components/responsesoutputmodality.py - src/openrouter/components/responsesoutputmodality.py
- src/openrouter/components/responsessearchcontextsize.py - src/openrouter/components/responsessearchcontextsize.py
- src/openrouter/components/responsesservertooloutput.py
- src/openrouter/components/responseswebsearchcalloutput.py - src/openrouter/components/responseswebsearchcalloutput.py
- src/openrouter/components/responseswebsearchservertool.py
- src/openrouter/components/responseswebsearchuserlocation.py - src/openrouter/components/responseswebsearchuserlocation.py
- src/openrouter/components/responsetextconfig.py - src/openrouter/components/responsetextconfig.py
- src/openrouter/components/security.py - src/openrouter/components/security.py
@@ -1058,8 +1004,6 @@ generatedFiles:
- src/openrouter/components/videoinput.py - src/openrouter/components/videoinput.py
- src/openrouter/components/websearchengine.py - src/openrouter/components/websearchengine.py
- src/openrouter/components/websearchpreviewtooluserlocation.py - src/openrouter/components/websearchpreviewtooluserlocation.py
- src/openrouter/components/websearchservertool.py
- src/openrouter/components/websearchshorthand.py
- src/openrouter/components/websearchstatus.py - src/openrouter/components/websearchstatus.py
- src/openrouter/credits.py - src/openrouter/credits.py
- src/openrouter/embeddings.py - src/openrouter/embeddings.py
@@ -1067,7 +1011,6 @@ generatedFiles:
- src/openrouter/errors/__init__.py - src/openrouter/errors/__init__.py
- src/openrouter/errors/badgatewayresponse_error.py - src/openrouter/errors/badgatewayresponse_error.py
- src/openrouter/errors/badrequestresponse_error.py - src/openrouter/errors/badrequestresponse_error.py
- src/openrouter/errors/conflictresponse_error.py
- src/openrouter/errors/edgenetworktimeoutresponse_error.py - src/openrouter/errors/edgenetworktimeoutresponse_error.py
- src/openrouter/errors/forbiddenresponse_error.py - src/openrouter/errors/forbiddenresponse_error.py
- src/openrouter/errors/internalserverresponse_error.py - src/openrouter/errors/internalserverresponse_error.py
@@ -1159,7 +1102,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", "status": "completed", "completed_at": 2510.63, "output": [{"type": "message", "status": "completed"}], "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} 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":
@@ -1477,8 +1420,6 @@ examples:
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"500": "500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}} application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
"409":
application/json: {"error": {"code": 409, "message": "Resource conflict. Please try again later."}}
sendChatCompletionRequest: sendChatCompletionRequest:
speakeasy-default-send-chat-completion-request: speakeasy-default-send-chat-completion-request:
requestBody: requestBody:
+1 -1
View File
@@ -31,7 +31,7 @@ generation:
skipResponseBodyAssertions: false skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true preApplyUnionDiscriminators: true
python: python:
version: 0.9.0 version: 0.8.0
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
+7 -698
View File
@@ -589,31 +589,6 @@ components:
id: imagegen-abc123 id: imagegen-abc123
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
status: completed status: completed
ResponsesServerToolOutput:
type: object
properties:
type:
type: string
pattern: '^openrouter:'
description: Server tool type (e.g. openrouter:datetime, openrouter:web_search)
id:
type: string
status:
type: string
enum:
- completed
- in_progress
- incomplete
required:
- type
- status
additionalProperties:
nullable: true
description: A generic OpenRouter server tool output item
example:
type: openrouter:web_search
id: ws_tmp_abc123
status: completed
ResponsesOutputItem: ResponsesOutputItem:
anyOf: anyOf:
- $ref: '#/components/schemas/ResponsesOutputMessage' - $ref: '#/components/schemas/ResponsesOutputMessage'
@@ -622,7 +597,6 @@ components:
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
- $ref: '#/components/schemas/ResponsesImageGenerationCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall'
- $ref: '#/components/schemas/ResponsesServerToolOutput'
description: An output item from the response description: An output item from the response
example: example:
id: msg-abc123 id: msg-abc123
@@ -1088,39 +1062,6 @@ components:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation' $ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
engine; ignored with native provider search.
example: 5
filters:
type: object
nullable: true
properties:
allowed_domains:
type: array
nullable: true
items:
type: string
excluded_domains:
type: array
nullable: true
items:
type: string
required: required:
- type - type
description: Web search preview tool configuration description: Web search preview tool configuration
@@ -1137,39 +1078,6 @@ components:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation' $ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
engine; ignored with native provider search.
example: 5
filters:
type: object
nullable: true
properties:
allowed_domains:
type: array
nullable: true
items:
type: string
excluded_domains:
type: array
nullable: true
items:
type: string
required: required:
- type - type
description: Web search preview tool configuration (2025-03-11 version) description: Web search preview tool configuration (2025-03-11 version)
@@ -1218,40 +1126,15 @@ components:
nullable: true nullable: true
items: items:
type: string type: string
excluded_domains:
type: array
nullable: true
items:
type: string
search_context_size: search_context_size:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/ResponsesWebSearchUserLocation' $ref: '#/components/schemas/ResponsesWebSearchUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
engine; ignored with native provider search.
example: 5
required: required:
- type - type
description: Web search tool configuration description: Web search tool configuration
example: example:
type: web_search type: web_search
engine: auto
filters: filters:
allowed_domains: allowed_domains:
- example.com - example.com
@@ -1271,40 +1154,15 @@ components:
nullable: true nullable: true
items: items:
type: string type: string
excluded_domains:
type: array
nullable: true
items:
type: string
search_context_size: search_context_size:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/ResponsesWebSearchUserLocation' $ref: '#/components/schemas/ResponsesWebSearchUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
engine; ignored with native provider search.
example: 5
required: required:
- type - type
description: Web search tool configuration (2025-08-26 version) description: Web search tool configuration (2025-08-26 version)
example: example:
type: web_search_2025_08_26 type: web_search_2025_08_26
engine: auto
filters: filters:
allowed_domains: allowed_domains:
- example.com - example.com
@@ -3115,93 +2973,6 @@ components:
output_index: 0 output_index: 0
sequence_number: 4 sequence_number: 4
item_id: call-123 item_id: call-123
OpenAIResponsesWebSearchCallInProgress:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.in_progress
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallInProgress:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
- type: object
properties: {}
description: Web search call in progress
example:
type: response.web_search_call.in_progress
output_index: 0
sequence_number: 1
item_id: ws-123
OpenAIResponsesWebSearchCallSearching:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.searching
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallSearching:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
- type: object
properties: {}
description: Web search call is searching
example:
type: response.web_search_call.searching
output_index: 0
sequence_number: 2
item_id: ws-123
OpenAIResponsesSearchCompleted:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.completed
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallCompleted:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
- type: object
properties: {}
description: Web search call completed
example:
type: response.web_search_call.completed
output_index: 0
sequence_number: 3
item_id: ws-123
OpenResponsesStreamEvent: OpenResponsesStreamEvent:
oneOf: oneOf:
- allOf: - allOf:
@@ -3589,9 +3360,6 @@ components:
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating' - $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage' - $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted' - $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted'
description: Union of all possible event types emitted during response streaming description: Union of all possible event types emitted during response streaming
example: example:
type: response.created type: response.created
@@ -4332,41 +4100,10 @@ components:
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
- $ref: '#/components/schemas/ResponsesImageGenerationCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall'
- $ref: '#/components/schemas/ResponsesServerToolOutput'
description: Input for a response request - can be a string or array of items description: Input for a response request - can be a string or array of items
example: example:
- role: user - role: user
content: What is the weather today? content: What is the weather today?
ResponsesWebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
max_results:
type: number
minimum: 1
maximum: 25
description: Maximum number of search results to return per search call. Defaults to 5.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is
reached, the tool will stop returning new results.
example: 20
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
max_results: 5
OpenResponsesResponseText: OpenResponsesResponseText:
allOf: allOf:
- $ref: '#/components/schemas/ResponseTextConfig' - $ref: '#/components/schemas/ResponseTextConfig'
@@ -4642,11 +4379,6 @@ components:
engine: engine:
$ref: '#/components/schemas/PDFParserEngine' $ref: '#/components/schemas/PDFParserEngine'
description: Options for PDF parsing. description: Options for PDF parsing.
ContextCompressionEngine:
type: string
enum:
- middle-out
description: The compression engine to use. Defaults to "middle-out".
OpenResponsesRequest: OpenResponsesRequest:
type: object type: object
properties: properties:
@@ -4660,7 +4392,7 @@ components:
tools: tools:
type: array type: array
items: items:
anyOf: oneOf:
- allOf: - allOf:
- $ref: '#/components/schemas/OpenResponsesFunctionTool' - $ref: '#/components/schemas/OpenResponsesFunctionTool'
- type: object - type: object
@@ -4696,8 +4428,6 @@ components:
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool' - $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool' - $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
- $ref: '#/components/schemas/OpenResponsesCustomTool' - $ref: '#/components/schemas/OpenResponsesCustomTool'
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ResponsesWebSearchServerTool'
tool_choice: tool_choice:
$ref: '#/components/schemas/OpenAIResponsesToolChoice' $ref: '#/components/schemas/OpenAIResponsesToolChoice'
parallel_tool_calls: parallel_tool_calls:
@@ -5010,19 +4740,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -10003,89 +9720,6 @@ components:
- role - role
- content - content
description: Anthropic message with OpenRouter extensions description: Anthropic message with OpenRouter extensions
AnthropicWebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is
reached, the tool will stop returning new results. Useful for controlling cost and context size in
agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
Exa engine; ignored with native provider search.
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
provider search.
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
max_results: 5
AnthropicOutputConfig: AnthropicOutputConfig:
type: object type: object
properties: properties:
@@ -10306,7 +9940,7 @@ components:
tools: tools:
type: array type: array
items: items:
anyOf: oneOf:
- type: object - type: object
properties: properties:
name: name:
@@ -10465,8 +10099,6 @@ components:
required: required:
- type - type
- name - name
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/AnthropicWebSearchServerTool'
tool_choice: tool_choice:
oneOf: oneOf:
- type: object - type: object
@@ -10909,19 +10541,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -12216,262 +11835,8 @@ components:
- $ref: '#/components/schemas/NamedToolChoice' - $ref: '#/components/schemas/NamedToolChoice'
description: Tool choice configuration description: Tool choice configuration
example: auto example: auto
DatetimeServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:datetime
parameters:
type: object
properties:
timezone:
type: string
description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
example: America/New_York
required:
- type
description: 'OpenRouter built-in server tool: returns the current date and time'
example:
type: openrouter:datetime
parameters:
timezone: America/New_York
WebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is
reached, the tool will stop returning new results. Useful for controlling cost and context size in
agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
Exa engine; ignored with native provider search.
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
provider search.
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
engine: auto
max_results: 5
WebSearchShorthand:
type: object
properties:
type:
type: string
enum:
- web_search
- web_search_preview
- web_search_preview_2025_03_11
- web_search_2025_08_26
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain
filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa
engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is
reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa
engine; ignored with native provider search.
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider
search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
provider search.
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa.
"native" forces the provider's built-in search (parameters like max_results, search_context_size, and
domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the
Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is
reached, the tool will stop returning new results. Useful for controlling cost and context size in
agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the
Exa engine; ignored with native provider search.
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native
provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native
provider search.
required:
- type
description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
ToolDefinitionJson: ToolDefinitionJson:
anyOf: type: object
- type: object
properties: properties:
type: type:
type: string type: string
@@ -12526,10 +11891,7 @@ components:
required: required:
- type - type
- function - function
- $ref: '#/components/schemas/DatetimeServerTool' description: Tool definition for function calling
- $ref: '#/components/schemas/WebSearchServerTool'
- $ref: '#/components/schemas/WebSearchShorthand'
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
example: example:
type: function type: function
function: function:
@@ -12775,19 +12137,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -13961,40 +13310,6 @@ components:
p75: 38.5 p75: 38.5
p90: 28.3 p90: 28.3
p99: 15.1 p99: 15.1
ConflictResponseErrorData:
type: object
properties:
code:
type: integer
message:
type: string
metadata:
type: object
nullable: true
additionalProperties:
nullable: true
required:
- code
- message
description: Error data for ConflictResponse
example:
code: 409
message: Resource conflict. Please try again later.
ConflictResponse:
type: object
properties:
error:
$ref: '#/components/schemas/ConflictResponseErrorData'
user_id:
type: string
nullable: true
required:
- error
description: Conflict - Resource conflict or concurrent modification
example:
error:
code: 409
message: Resource conflict. Please try again later.
parameters: {} parameters: {}
securitySchemes: securitySchemes:
apiKey: apiKey:
@@ -15364,7 +14679,7 @@ paths:
description: >- description: >-
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
embeddings) or "all" to include all models. Defaults to "text". embeddings) or "all" to include all models. Defaults to "text".
name: output_modalities name: output_modality
in: query in: query
responses: responses:
'200': '200':
@@ -15374,7 +14689,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/ModelsCountResponse' $ref: '#/components/schemas/ModelsCountResponse'
'400': '400':
description: Bad Request - Invalid output_modalities value description: Bad Request - Invalid output_modality value
content: content:
application/json: application/json:
schema: schema:
@@ -15429,7 +14744,7 @@ paths:
description: >- description: >-
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
embeddings) or "all" to include all models. Defaults to "text". embeddings) or "all" to include all models. Defaults to "text".
name: output_modalities name: output_modality
in: query in: query
- schema: - schema:
type: string type: string
@@ -18531,12 +17846,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/UnauthorizedResponse' $ref: '#/components/schemas/UnauthorizedResponse'
'409':
description: Conflict - App upsert conflict during auth code creation
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictResponse'
'500': '500':
description: Internal Server Error - Unexpected server error description: Internal Server Error - Unexpected server error
content: content:
+7 -667
View File
@@ -591,32 +591,6 @@ components:
id: imagegen-abc123 id: imagegen-abc123
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
status: completed status: completed
ResponsesServerToolOutput:
type: object
properties:
type:
type: string
pattern: '^openrouter:'
description: Server tool type (e.g. openrouter:datetime, openrouter:web_search)
id:
type: string
status:
type: string
enum:
- completed
- in_progress
- incomplete
x-speakeasy-unknown-values: allow
required:
- type
- status
additionalProperties:
nullable: true
description: A generic OpenRouter server tool output item
example:
type: openrouter:web_search
id: ws_tmp_abc123
status: completed
ResponsesOutputItem: ResponsesOutputItem:
anyOf: anyOf:
- $ref: '#/components/schemas/ResponsesOutputMessage' - $ref: '#/components/schemas/ResponsesOutputMessage'
@@ -625,7 +599,6 @@ components:
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
- $ref: '#/components/schemas/ResponsesImageGenerationCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall'
- $ref: '#/components/schemas/ResponsesServerToolOutput'
description: An output item from the response description: An output item from the response
example: example:
id: msg-abc123 id: msg-abc123
@@ -1097,37 +1070,6 @@ components:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation' $ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
filters:
type: object
nullable: true
properties:
allowed_domains:
type: array
nullable: true
items:
type: string
excluded_domains:
type: array
nullable: true
items:
type: string
required: required:
- type - type
description: Web search preview tool configuration description: Web search preview tool configuration
@@ -1144,37 +1086,6 @@ components:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/WebSearchPreviewToolUserLocation' $ref: '#/components/schemas/WebSearchPreviewToolUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
filters:
type: object
nullable: true
properties:
allowed_domains:
type: array
nullable: true
items:
type: string
excluded_domains:
type: array
nullable: true
items:
type: string
required: required:
- type - type
description: Web search preview tool configuration (2025-03-11 version) description: Web search preview tool configuration (2025-03-11 version)
@@ -1223,38 +1134,15 @@ components:
nullable: true nullable: true
items: items:
type: string type: string
excluded_domains:
type: array
nullable: true
items:
type: string
search_context_size: search_context_size:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/ResponsesWebSearchUserLocation' $ref: '#/components/schemas/ResponsesWebSearchUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
required: required:
- type - type
description: Web search tool configuration description: Web search tool configuration
example: example:
type: web_search type: web_search
engine: auto
filters: filters:
allowed_domains: allowed_domains:
- example.com - example.com
@@ -1274,38 +1162,15 @@ components:
nullable: true nullable: true
items: items:
type: string type: string
excluded_domains:
type: array
nullable: true
items:
type: string
search_context_size: search_context_size:
$ref: '#/components/schemas/ResponsesSearchContextSize' $ref: '#/components/schemas/ResponsesSearchContextSize'
user_location: user_location:
$ref: '#/components/schemas/ResponsesWebSearchUserLocation' $ref: '#/components/schemas/ResponsesWebSearchUserLocation'
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
required: required:
- type - type
description: Web search tool configuration (2025-08-26 version) description: Web search tool configuration (2025-08-26 version)
example: example:
type: web_search_2025_08_26 type: web_search_2025_08_26
engine: auto
filters: filters:
allowed_domains: allowed_domains:
- example.com - example.com
@@ -3136,93 +3001,6 @@ components:
output_index: 0 output_index: 0
sequence_number: 4 sequence_number: 4
item_id: call-123 item_id: call-123
OpenAIResponsesWebSearchCallInProgress:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.in_progress
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallInProgress:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
- type: object
properties: {}
description: Web search call in progress
example:
type: response.web_search_call.in_progress
output_index: 0
sequence_number: 1
item_id: ws-123
OpenAIResponsesWebSearchCallSearching:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.searching
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallSearching:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
- type: object
properties: {}
description: Web search call is searching
example:
type: response.web_search_call.searching
output_index: 0
sequence_number: 2
item_id: ws-123
OpenAIResponsesSearchCompleted:
type: object
properties:
type:
type: string
enum:
- response.web_search_call.completed
item_id:
type: string
output_index:
type: number
sequence_number:
type: number
required:
- type
- item_id
- output_index
- sequence_number
OpenResponsesWebSearchCallCompleted:
allOf:
- $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
- type: object
properties: {}
description: Web search call completed
example:
type: response.web_search_call.completed
output_index: 0
sequence_number: 3
item_id: ws-123
OpenResponsesStreamEvent: OpenResponsesStreamEvent:
oneOf: oneOf:
- allOf: - allOf:
@@ -3610,9 +3388,6 @@ components:
- $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating' - $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating'
- $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage' - $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage'
- $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted' - $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallInProgress'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallSearching'
- $ref: '#/components/schemas/OpenResponsesWebSearchCallCompleted'
description: Union of all possible event types emitted during response streaming description: Union of all possible event types emitted during response streaming
example: example:
type: response.created type: response.created
@@ -4352,40 +4127,10 @@ components:
- $ref: '#/components/schemas/ResponsesWebSearchCallOutput' - $ref: '#/components/schemas/ResponsesWebSearchCallOutput'
- $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall' - $ref: '#/components/schemas/ResponsesOutputItemFileSearchCall'
- $ref: '#/components/schemas/ResponsesImageGenerationCall' - $ref: '#/components/schemas/ResponsesImageGenerationCall'
- $ref: '#/components/schemas/ResponsesServerToolOutput'
description: Input for a response request - can be a string or array of items description: Input for a response request - can be a string or array of items
example: example:
- role: user - role: user
content: What is the weather today? content: What is the weather today?
ResponsesWebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
max_results:
type: number
minimum: 1
maximum: 25
description: Maximum number of search results to return per search call. Defaults to 5.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results.
example: 20
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
max_results: 5
OpenResponsesResponseText: OpenResponsesResponseText:
allOf: allOf:
- $ref: '#/components/schemas/ResponseTextConfig' - $ref: '#/components/schemas/ResponseTextConfig'
@@ -4663,11 +4408,6 @@ components:
engine: engine:
$ref: '#/components/schemas/PDFParserEngine' $ref: '#/components/schemas/PDFParserEngine'
description: Options for PDF parsing. description: Options for PDF parsing.
ContextCompressionEngine:
type: string
enum:
- middle-out
description: The compression engine to use. Defaults to "middle-out".
OpenResponsesRequest: OpenResponsesRequest:
type: object type: object
properties: properties:
@@ -4681,7 +4421,7 @@ components:
tools: tools:
type: array type: array
items: items:
anyOf: oneOf:
- allOf: - allOf:
- $ref: '#/components/schemas/OpenResponsesFunctionTool' - $ref: '#/components/schemas/OpenResponsesFunctionTool'
- type: object - type: object
@@ -4718,8 +4458,6 @@ components:
- $ref: '#/components/schemas/OpenResponsesFunctionShellTool' - $ref: '#/components/schemas/OpenResponsesFunctionShellTool'
- $ref: '#/components/schemas/OpenResponsesApplyPatchTool' - $ref: '#/components/schemas/OpenResponsesApplyPatchTool'
- $ref: '#/components/schemas/OpenResponsesCustomTool' - $ref: '#/components/schemas/OpenResponsesCustomTool'
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/ResponsesWebSearchServerTool'
tool_choice: tool_choice:
$ref: '#/components/schemas/OpenAIResponsesToolChoice' $ref: '#/components/schemas/OpenAIResponsesToolChoice'
parallel_tool_calls: parallel_tool_calls:
@@ -5017,19 +4755,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -10059,83 +9784,6 @@ components:
- role - role
- content - content
description: Anthropic message with OpenRouter extensions description: Anthropic message with OpenRouter extensions
AnthropicWebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
x-speakeasy-unknown-values: allow
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
max_results: 5
AnthropicOutputConfig: AnthropicOutputConfig:
type: object type: object
properties: properties:
@@ -10356,7 +10004,7 @@ components:
tools: tools:
type: array type: array
items: items:
anyOf: oneOf:
- type: object - type: object
properties: properties:
name: name:
@@ -10519,8 +10167,6 @@ components:
required: required:
- type - type
- name - name
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/AnthropicWebSearchServerTool'
tool_choice: tool_choice:
oneOf: oneOf:
- type: object - type: object
@@ -10951,19 +10597,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -12257,245 +11890,8 @@ components:
- $ref: '#/components/schemas/NamedToolChoice' - $ref: '#/components/schemas/NamedToolChoice'
description: Tool choice configuration description: Tool choice configuration
example: auto example: auto
DatetimeServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:datetime
parameters:
type: object
properties:
timezone:
type: string
description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
example: America/New_York
required:
- type
description: 'OpenRouter built-in server tool: returns the current date and time'
example:
type: openrouter:datetime
parameters:
timezone: America/New_York
WebSearchServerTool:
type: object
properties:
type:
type: string
enum:
- openrouter:web_search
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
x-speakeasy-unknown-values: allow
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
required:
- type
description: 'OpenRouter built-in server tool: searches the web for current information'
example:
type: openrouter:web_search
parameters:
engine: auto
max_results: 5
WebSearchShorthand:
type: object
properties:
type:
type: string
enum:
- web_search
- web_search_preview
- web_search_preview_2025_03_11
- web_search_2025_08_26
x-speakeasy-unknown-values: allow
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
x-speakeasy-unknown-values: allow
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
parameters:
type: object
properties:
engine:
type: string
enum:
- auto
- native
- exa
description: >-
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
example: auto
x-speakeasy-unknown-values: allow
max_results:
type: number
minimum: 1
maximum: 25
description: >-
Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search.
example: 5
max_total_results:
type: number
minimum: 1
description: >-
Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops.
example: 20
search_context_size:
type: string
enum:
- low
- medium
- high
description: >-
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
x-speakeasy-unknown-values: allow
user_location:
type: object
properties:
type:
type: string
enum:
- approximate
city:
type: string
region:
type: string
country:
type: string
timezone:
type: string
description: Approximate user location for location-biased results.
allowed_domains:
type: array
items:
type: string
description: >-
Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search.
excluded_domains:
type: array
items:
type: string
description: >-
Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search.
required:
- type
description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
ToolDefinitionJson: ToolDefinitionJson:
anyOf: type: object
- type: object
properties: properties:
type: type:
type: string type: string
@@ -12550,10 +11946,7 @@ components:
required: required:
- type - type
- function - function
- $ref: '#/components/schemas/DatetimeServerTool' description: Tool definition for function calling
- $ref: '#/components/schemas/WebSearchServerTool'
- $ref: '#/components/schemas/WebSearchShorthand'
description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
example: example:
type: function type: function
function: function:
@@ -12785,19 +12178,6 @@ components:
description: Set to false to disable the response-healing plugin for this request. Defaults to true. description: Set to false to disable the response-healing plugin for this request. Defaults to true.
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- context-compression
enabled:
type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
route: route:
type: string type: string
@@ -13963,40 +13343,6 @@ components:
p75: 38.5 p75: 38.5
p90: 28.3 p90: 28.3
p99: 15.1 p99: 15.1
ConflictResponseErrorData:
type: object
properties:
code:
type: integer
message:
type: string
metadata:
type: object
nullable: true
additionalProperties:
nullable: true
required:
- code
- message
description: Error data for ConflictResponse
example:
code: 409
message: Resource conflict. Please try again later.
ConflictResponse:
type: object
properties:
error:
$ref: '#/components/schemas/ConflictResponseErrorData'
user_id:
type: string
nullable: true
required:
- error
description: Conflict - Resource conflict or concurrent modification
example:
error:
code: 409
message: Resource conflict. Please try again later.
parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-OpenRouter-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}, AppCategories: {name: X-OpenRouter-Categories, in: header, schema: {type: string}, description: "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"}} parameters: {AppIdentifier: {name: HTTP-Referer, in: header, schema: {type: string}, description: "The app identifier should be your app's URL and is used as the primary identifier for rankings.\nThis is used to track API usage per application.\n"}, AppDisplayName: {name: X-OpenRouter-Title, in: header, schema: {type: string}, description: "The app display name allows you to customize how your app appears in OpenRouter's dashboard.\n"}, AppCategories: {name: X-OpenRouter-Categories, in: header, schema: {type: string}, description: "Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.\n"}}
securitySchemes: securitySchemes:
apiKey: apiKey:
@@ -15399,7 +14745,7 @@ paths:
required: false required: false
description: >- description: >-
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
name: output_modalities name: output_modality
in: query in: query
responses: responses:
'200': '200':
@@ -15409,7 +14755,7 @@ paths:
schema: schema:
$ref: '#/components/schemas/ModelsCountResponse' $ref: '#/components/schemas/ModelsCountResponse'
'400': '400':
description: Bad Request - Invalid output_modalities value description: Bad Request - Invalid output_modality value
content: content:
application/json: application/json:
schema: schema:
@@ -15467,7 +14813,7 @@ paths:
required: false required: false
description: >- description: >-
Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text".
name: output_modalities name: output_modality
in: query in: query
responses: responses:
'200': '200':
@@ -18615,12 +17961,6 @@ paths:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/UnauthorizedResponse' $ref: '#/components/schemas/UnauthorizedResponse'
'409':
description: Conflict - App upsert conflict during auth code creation
content:
application/json:
schema:
$ref: '#/components/schemas/ConflictResponse'
'500': '500':
description: Internal Server Error - Unexpected server error description: Internal Server Error - Unexpected server error
content: content:
+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:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca sourceRevisionDigest: sha256:2fa3ed22056b6be20af56e6548a094381d1d32359ecdfec536c73556fc9717aa
sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d sourceBlobDigest: sha256:f445d8b8c9319ec5f7ab85c2b6194692070cc259047254a08a6b1c127cef09dd
tags: tags:
- latest - latest
- main - main
@@ -18,10 +18,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:33bc86b7a9b24082a410a8b5cbdd05ee359c9be2c88a2947893942d6bca20dca sourceRevisionDigest: sha256:2fa3ed22056b6be20af56e6548a094381d1d32359ecdfec536c73556fc9717aa
sourceBlobDigest: sha256:63c840be5dfe448c1d3f6ec9c15e1d92d117b35cccd134b1e736e1fb563d013d sourceBlobDigest: sha256:f445d8b8c9319ec5f7ab85c2b6194692070cc259047254a08a6b1c127cef09dd
codeSamplesNamespace: open-router-python-code-samples codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:b23dcc24419d8d006315e89e7a2fe131e28d72f19edb4fa920c97658e9e78073 codeSamplesRevisionDigest: sha256:8c9d4cec31e4cfe341de1c43b2f557a838837aad7923f86a2eb62ae3c95d09a9
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
@@ -1,8 +0,0 @@
# ChatGenerationParamsIDContextCompression
## Values
| Name | Value |
| --------------------- | --------------------- |
| `CONTEXT_COMPRESSION` | context-compression |
@@ -1,10 +0,0 @@
# ChatGenerationParamsPluginContextCompression
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `id` | [components.ChatGenerationParamsIDContextCompression](../components/chatgenerationparamsidcontextcompression.md) | :heavy_check_mark: | N/A |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. |
| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". |
@@ -33,9 +33,3 @@ value: components.ChatGenerationParamsPluginFileParser = /* values here */
value: components.ChatGenerationParamsPluginResponseHealing = /* values here */ value: components.ChatGenerationParamsPluginResponseHealing = /* values here */
``` ```
### `components.ChatGenerationParamsPluginContextCompression`
```python
value: components.ChatGenerationParamsPluginContextCompression = /* values here */
```
@@ -1,12 +0,0 @@
# ConflictResponseErrorData
Error data for ConflictResponse
## Fields
| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `code` | *int* | :heavy_check_mark: | N/A |
| `message` | *str* | :heavy_check_mark: | N/A |
| `metadata` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
@@ -1,10 +0,0 @@
# ContextCompressionEngine
The compression engine to use. Defaults to "middle-out".
## Values
| Name | Value |
| ------------ | ------------ |
| `MIDDLE_OUT` | middle-out |
-11
View File
@@ -1,11 +0,0 @@
# DatetimeServerTool
OpenRouter built-in server tool: returns the current date and time
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `type` | [components.DatetimeServerToolType](../components/datetimeservertooltype.md) | :heavy_check_mark: | N/A |
| `parameters` | [Optional[components.DatetimeServerToolParameters]](../components/datetimeservertoolparameters.md) | :heavy_minus_sign: | N/A |
@@ -1,8 +0,0 @@
# DatetimeServerToolParameters
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- |
| `timezone` | *Optional[str]* | :heavy_minus_sign: | IANA timezone name (e.g. "America/New_York"). Defaults to UTC. | America/New_York |
@@ -1,8 +0,0 @@
# DatetimeServerToolType
## Values
| Name | Value |
| --------------------- | --------------------- |
| `OPENROUTER_DATETIME` | openrouter:datetime |
@@ -69,9 +69,3 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */
value: components.ResponsesImageGenerationCall = /* values here */ value: components.ResponsesImageGenerationCall = /* values here */
``` ```
### `components.ResponsesServerToolOutput`
```python
value: components.ResponsesServerToolOutput = /* values here */
```
@@ -1,8 +0,0 @@
# OpenResponsesRequestIDContextCompression
## Values
| Name | Value |
| --------------------- | --------------------- |
| `CONTEXT_COMPRESSION` | context-compression |
@@ -1,10 +0,0 @@
# OpenResponsesRequestPluginContextCompression
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `id` | [components.OpenResponsesRequestIDContextCompression](../components/openresponsesrequestidcontextcompression.md) | :heavy_check_mark: | N/A |
| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the context-compression plugin for this request. Defaults to true. |
| `engine` | [Optional[components.ContextCompressionEngine]](../components/contextcompressionengine.md) | :heavy_minus_sign: | The compression engine to use. Defaults to "middle-out". |
@@ -33,9 +33,3 @@ value: components.OpenResponsesRequestPluginFileParser = /* values here */
value: components.OpenResponsesRequestPluginResponseHealing = /* values here */ value: components.OpenResponsesRequestPluginResponseHealing = /* values here */
``` ```
### `components.OpenResponsesRequestPluginContextCompression`
```python
value: components.OpenResponsesRequestPluginContextCompression = /* values here */
```
@@ -87,15 +87,3 @@ value: components.OpenResponsesApplyPatchTool = /* values here */
value: components.OpenResponsesCustomTool = /* values here */ value: components.OpenResponsesCustomTool = /* values here */
``` ```
### `components.DatetimeServerTool`
```python
value: components.DatetimeServerTool = /* values here */
```
### `components.ResponsesWebSearchServerTool`
```python
value: components.ResponsesWebSearchServerTool = /* values here */
```
@@ -167,21 +167,3 @@ value: components.OpenResponsesImageGenCallPartialImage = /* values here */
value: components.OpenResponsesImageGenCallCompleted = /* values here */ value: components.OpenResponsesImageGenCallCompleted = /* values here */
``` ```
### `components.OpenResponsesWebSearchCallInProgress`
```python
value: components.OpenResponsesWebSearchCallInProgress = /* values here */
```
### `components.OpenResponsesWebSearchCallSearching`
```python
value: components.OpenResponsesWebSearchCallSearching = /* values here */
```
### `components.OpenResponsesWebSearchCallCompleted`
```python
value: components.OpenResponsesWebSearchCallCompleted = /* values here */
```
@@ -6,10 +6,8 @@ Web search tool configuration (2025-08-26 version)
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | | | `type` | [components.OpenResponsesWebSearch20250826ToolType](../components/openresponseswebsearch20250826tooltype.md) | :heavy_check_mark: | N/A | |
| `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | | | `filters` | [OptionalNullable[components.OpenResponsesWebSearch20250826ToolFilters]](../components/openresponseswebsearch20250826toolfilters.md) | :heavy_minus_sign: | N/A | |
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} | | `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
| `engine` | [Optional[components.OpenResponsesWebSearch20250826ToolEngine]](../components/openresponseswebsearch20250826toolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
@@ -1,12 +0,0 @@
# OpenResponsesWebSearch20250826ToolEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -6,4 +6,3 @@
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ | | ------------------ | ------------------ | ------------------ | ------------------ |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
@@ -1,13 +0,0 @@
# OpenResponsesWebSearchCallCompleted
Web search call completed
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesWebSearchCallCompletedType](../components/openresponseswebsearchcallcompletedtype.md) | :heavy_check_mark: | N/A |
| `item_id` | *str* | :heavy_check_mark: | N/A |
| `output_index` | *float* | :heavy_check_mark: | N/A |
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
@@ -1,8 +0,0 @@
# OpenResponsesWebSearchCallCompletedType
## Values
| Name | Value |
| ------------------------------------ | ------------------------------------ |
| `RESPONSE_WEB_SEARCH_CALL_COMPLETED` | response.web_search_call.completed |
@@ -1,13 +0,0 @@
# OpenResponsesWebSearchCallInProgress
Web search call in progress
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesWebSearchCallInProgressType](../components/openresponseswebsearchcallinprogresstype.md) | :heavy_check_mark: | N/A |
| `item_id` | *str* | :heavy_check_mark: | N/A |
| `output_index` | *float* | :heavy_check_mark: | N/A |
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
@@ -1,8 +0,0 @@
# OpenResponsesWebSearchCallInProgressType
## Values
| Name | Value |
| -------------------------------------- | -------------------------------------- |
| `RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS` | response.web_search_call.in_progress |
@@ -1,13 +0,0 @@
# OpenResponsesWebSearchCallSearching
Web search call is searching
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesWebSearchCallSearchingType](../components/openresponseswebsearchcallsearchingtype.md) | :heavy_check_mark: | N/A |
| `item_id` | *str* | :heavy_check_mark: | N/A |
| `output_index` | *float* | :heavy_check_mark: | N/A |
| `sequence_number` | *float* | :heavy_check_mark: | N/A |
@@ -1,8 +0,0 @@
# OpenResponsesWebSearchCallSearchingType
## Values
| Name | Value |
| ------------------------------------ | ------------------------------------ |
| `RESPONSE_WEB_SEARCH_CALL_SEARCHING` | response.web_search_call.searching |
@@ -6,10 +6,7 @@ Web search preview tool configuration (2025-03-11 version)
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | | | `type` | [components.OpenResponsesWebSearchPreview20250311ToolType](../components/openresponseswebsearchpreview20250311tooltype.md) | :heavy_check_mark: | N/A | |
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | | `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
| `engine` | [Optional[components.OpenResponsesWebSearchPreview20250311ToolEngine]](../components/openresponseswebsearchpreview20250311toolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreview20250311ToolFilters]](../components/openresponseswebsearchpreview20250311toolfilters.md) | :heavy_minus_sign: | N/A | |
@@ -1,12 +0,0 @@
# OpenResponsesWebSearchPreview20250311ToolEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -1,9 +0,0 @@
# OpenResponsesWebSearchPreview20250311ToolFilters
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
@@ -6,10 +6,7 @@ Web search preview tool configuration
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | | | `type` | [components.OpenResponsesWebSearchPreviewToolType](../components/openresponseswebsearchpreviewtooltype.md) | :heavy_check_mark: | N/A | |
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
| `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | | | `user_location` | [OptionalNullable[components.WebSearchPreviewToolUserLocation]](../components/websearchpreviewtooluserlocation.md) | :heavy_minus_sign: | N/A | |
| `engine` | [Optional[components.OpenResponsesWebSearchPreviewToolEngine]](../components/openresponseswebsearchpreviewtoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchPreviewToolFilters]](../components/openresponseswebsearchpreviewtoolfilters.md) | :heavy_minus_sign: | N/A | |
@@ -1,12 +0,0 @@
# OpenResponsesWebSearchPreviewToolEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -1,9 +0,0 @@
# OpenResponsesWebSearchPreviewToolFilters
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
@@ -6,10 +6,8 @@ Web search tool configuration
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | | | `type` | [components.OpenResponsesWebSearchToolType](../components/openresponseswebsearchtooltype.md) | :heavy_check_mark: | N/A | |
| `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | | | `filters` | [OptionalNullable[components.OpenResponsesWebSearchToolFilters]](../components/openresponseswebsearchtoolfilters.md) | :heavy_minus_sign: | N/A | |
| `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium | | `search_context_size` | [Optional[components.ResponsesSearchContextSize]](../components/responsessearchcontextsize.md) | :heavy_minus_sign: | Size of the search context for web search tools | medium |
| `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} | | `user_location` | [OptionalNullable[components.ResponsesWebSearchUserLocation]](../components/responseswebsearchuserlocation.md) | :heavy_minus_sign: | User location information for web search | {<br/>"type": "approximate",<br/>"city": "San Francisco",<br/>"country": "USA",<br/>"region": "California",<br/>"timezone": "America/Los_Angeles"<br/>} |
| `engine` | [Optional[components.OpenResponsesWebSearchToolEngine]](../components/openresponseswebsearchtoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
@@ -1,12 +0,0 @@
# OpenResponsesWebSearchToolEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -6,4 +6,3 @@
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ | | ------------------ | ------------------ | ------------------ | ------------------ |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A | | `allowed_domains` | List[*str*] | :heavy_minus_sign: | N/A |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | N/A |
-6
View File
@@ -41,9 +41,3 @@ value: components.ResponsesOutputItemFileSearchCall = /* values here */
value: components.ResponsesImageGenerationCall = /* values here */ value: components.ResponsesImageGenerationCall = /* values here */
``` ```
### `components.ResponsesServerToolOutput`
```python
value: components.ResponsesServerToolOutput = /* values here */
```
@@ -1,13 +0,0 @@
# ResponsesServerToolOutput
A generic OpenRouter server tool output item
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `type` | *str* | :heavy_check_mark: | Server tool type (e.g. openrouter:datetime, openrouter:web_search) | |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `status` | [components.ResponsesServerToolOutputStatus](../components/responsesservertooloutputstatus.md) | :heavy_check_mark: | N/A | |
| `__pydantic_extra__` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A | {<br/>"type": "openrouter:web_search",<br/>"id": "ws_tmp_abc123",<br/>"status": "completed"<br/>} |
@@ -1,10 +0,0 @@
# ResponsesServerToolOutputStatus
## Values
| Name | Value |
| ------------- | ------------- |
| `COMPLETED` | completed |
| `IN_PROGRESS` | in_progress |
| `INCOMPLETE` | incomplete |
@@ -1,11 +0,0 @@
# ResponsesWebSearchServerTool
OpenRouter built-in server tool: searches the web for current information
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.ResponsesWebSearchServerToolType](../components/responseswebsearchservertooltype.md) | :heavy_check_mark: | N/A |
| `parameters` | [Optional[components.ResponsesWebSearchServerToolParameters]](../components/responseswebsearchservertoolparameters.md) | :heavy_minus_sign: | N/A |
@@ -1,9 +0,0 @@
# ResponsesWebSearchServerToolParameters
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. | 5 |
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. | 20 |
@@ -1,8 +0,0 @@
# ResponsesWebSearchServerToolType
## Values
| Name | Value |
| ----------------------- | ----------------------- |
| `OPENROUTER_WEB_SEARCH` | openrouter:web_search |
+7 -44
View File
@@ -1,49 +1,12 @@
# ToolDefinitionJSON # ToolDefinitionJSON
Tool definition for function calling (regular function or OpenRouter built-in server tool) Tool definition for function calling
## Supported Types ## Fields
### `components.ToolDefinitionJSONFunction`
```python
value: components.ToolDefinitionJSONFunction = /* values here */
```
### `components.DatetimeServerTool`
```python
value: components.DatetimeServerTool = /* values here */
```
### `components.WebSearchServerTool`
```python
value: components.WebSearchServerTool = /* values here */
```
### `components.WebSearchShorthand`
```python
value: components.WebSearchShorthand = /* values here */
```
### `components.WebSearchShorthand`
```python
value: components.WebSearchShorthand = /* values here */
```
### `components.WebSearchShorthand`
```python
value: components.WebSearchShorthand = /* values here */
```
### `components.WebSearchShorthand`
```python
value: components.WebSearchShorthand = /* values here */
```
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | |
| `function` | [components.ToolDefinitionJSONFunction](../components/tooldefinitionjsonfunction.md) | :heavy_check_mark: | Function definition for tool calling | {<br/>"name": "get_weather",<br/>"description": "Get the current weather for a location",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>}<br/>} |
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} |
@@ -1,10 +1,13 @@
# ToolDefinitionJSONFunction # ToolDefinitionJSONFunction
Function definition for tool calling
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.ToolDefinitionJSONType](../components/tooldefinitionjsontype.md) | :heavy_check_mark: | N/A | | | `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather |
| `function` | [components.ToolDefinitionJSONFunctionFunction](../components/tooldefinitionjsonfunctionfunction.md) | :heavy_check_mark: | Function definition for tool calling | {<br/>"name": "get_weather",<br/>"description": "Get the current weather for a location",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>}<br/>} | | `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location |
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | Cache control for the content part | {<br/>"type": "ephemeral",<br/>"ttl": "5m"<br/>} | | `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>} |
| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false |
@@ -1,13 +0,0 @@
# ToolDefinitionJSONFunctionFunction
Function definition for tool calling
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `name` | *str* | :heavy_check_mark: | Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) | get_weather |
| `description` | *Optional[str]* | :heavy_minus_sign: | Function description for the model | Get the current weather for a location |
| `parameters` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | Function parameters as JSON Schema object | {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string",<br/>"description": "City name"<br/>}<br/>},<br/>"required": [<br/>"location"<br/>]<br/>} |
| `strict` | *OptionalNullable[bool]* | :heavy_minus_sign: | Enable strict schema adherence | false |
-11
View File
@@ -1,11 +0,0 @@
# WebSearchServerTool
OpenRouter built-in server tool: searches the web for current information
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.WebSearchServerToolTypeOpenrouterWebSearch](../components/websearchservertooltypeopenrouterwebsearch.md) | :heavy_check_mark: | N/A |
| `parameters` | [Optional[components.WebSearchServerToolParameters]](../components/websearchservertoolparameters.md) | :heavy_minus_sign: | N/A |
@@ -1,12 +0,0 @@
# WebSearchServerToolEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -1,14 +0,0 @@
# WebSearchServerToolParameters
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `engine` | [Optional[components.WebSearchServerToolEngine]](../components/websearchservertoolengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
| `search_context_size` | [Optional[components.WebSearchServerToolSearchContextSize]](../components/websearchservertoolsearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
| `user_location` | [Optional[components.WebSearchServerToolUserLocation]](../components/websearchservertooluserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
@@ -1,8 +0,0 @@
# WebSearchServerToolParametersType
## Values
| Name | Value |
| ------------- | ------------- |
| `APPROXIMATE` | approximate |
@@ -1,12 +0,0 @@
# WebSearchServerToolSearchContextSize
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
## Values
| Name | Value |
| -------- | -------- |
| `LOW` | low |
| `MEDIUM` | medium |
| `HIGH` | high |
@@ -1,8 +0,0 @@
# WebSearchServerToolTypeOpenrouterWebSearch
## Values
| Name | Value |
| ----------------------- | ----------------------- |
| `OPENROUTER_WEB_SEARCH` | openrouter:web_search |
@@ -1,14 +0,0 @@
# WebSearchServerToolUserLocation
Approximate user location for location-biased results.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `type` | [Optional[components.WebSearchServerToolParametersType]](../components/websearchservertoolparameterstype.md) | :heavy_minus_sign: | N/A |
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
-18
View File
@@ -1,18 +0,0 @@
# WebSearchShorthand
Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | [components.WebSearchShorthandType](../components/websearchshorthandtype.md) | :heavy_check_mark: | N/A | |
| `engine` | [Optional[components.WebSearchShorthandEngine]](../components/websearchshorthandengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
| `search_context_size` | [Optional[components.WebSearchShorthandSearchContextSize]](../components/websearchshorthandsearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
| `user_location` | [Optional[components.WebSearchShorthandUserLocation]](../components/websearchshorthanduserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
| `parameters` | [Optional[components.WebSearchShorthandParameters]](../components/websearchshorthandparameters.md) | :heavy_minus_sign: | N/A | |
@@ -1,12 +0,0 @@
# WebSearchShorthandEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -1,14 +0,0 @@
# WebSearchShorthandParameters
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `engine` | [Optional[components.WebSearchShorthandParametersEngine]](../components/websearchshorthandparametersengine.md) | :heavy_minus_sign: | Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API. | auto |
| `max_results` | *Optional[float]* | :heavy_minus_sign: | Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search. | 5 |
| `max_total_results` | *Optional[float]* | :heavy_minus_sign: | Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops. | 20 |
| `search_context_size` | [Optional[components.WebSearchShorthandParametersSearchContextSize]](../components/websearchshorthandparameterssearchcontextsize.md) | :heavy_minus_sign: | How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search. | |
| `user_location` | [Optional[components.WebSearchShorthandParametersUserLocation]](../components/websearchshorthandparametersuserlocation.md) | :heavy_minus_sign: | Approximate user location for location-biased results. | |
| `allowed_domains` | List[*str*] | :heavy_minus_sign: | Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search. | |
| `excluded_domains` | List[*str*] | :heavy_minus_sign: | Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search. | |
@@ -1,12 +0,0 @@
# WebSearchShorthandParametersEngine
Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). "exa" forces the Exa search API.
## Values
| Name | Value |
| -------- | -------- |
| `AUTO` | auto |
| `NATIVE` | native |
| `EXA` | exa |
@@ -1,12 +0,0 @@
# WebSearchShorthandParametersSearchContextSize
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
## Values
| Name | Value |
| -------- | -------- |
| `LOW` | low |
| `MEDIUM` | medium |
| `HIGH` | high |
@@ -1,8 +0,0 @@
# WebSearchShorthandParametersType
## Values
| Name | Value |
| ------------- | ------------- |
| `APPROXIMATE` | approximate |
@@ -1,14 +0,0 @@
# WebSearchShorthandParametersUserLocation
Approximate user location for location-biased results.
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `type` | [Optional[components.WebSearchShorthandParametersType]](../components/websearchshorthandparameterstype.md) | :heavy_minus_sign: | N/A |
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
@@ -1,12 +0,0 @@
# WebSearchShorthandSearchContextSize
How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search.
## Values
| Name | Value |
| -------- | -------- |
| `LOW` | low |
| `MEDIUM` | medium |
| `HIGH` | high |
-11
View File
@@ -1,11 +0,0 @@
# WebSearchShorthandType
## Values
| Name | Value |
| ------------------------------- | ------------------------------- |
| `WEB_SEARCH` | web_search |
| `WEB_SEARCH_PREVIEW` | web_search_preview |
| `WEB_SEARCH_PREVIEW_2025_03_11` | web_search_preview_2025_03_11 |
| `WEB_SEARCH_2025_08_26` | web_search_2025_08_26 |
@@ -1,8 +0,0 @@
# WebSearchShorthandTypeApproximate
## Values
| Name | Value |
| ------------- | ------------- |
| `APPROXIMATE` | approximate |
@@ -1,14 +0,0 @@
# WebSearchShorthandUserLocation
Approximate user location for location-biased results.
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `type` | [Optional[components.WebSearchShorthandTypeApproximate]](../components/websearchshorthandtypeapproximate.md) | :heavy_minus_sign: | N/A |
| `city` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `region` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `country` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `timezone` | *Optional[str]* | :heavy_minus_sign: | N/A |
-11
View File
@@ -1,11 +0,0 @@
# ConflictResponseError
Conflict - Resource conflict or concurrent modification
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `error` | [components.ConflictResponseErrorData](../components/conflictresponseerrordata.md) | :heavy_check_mark: | Error data for ConflictResponse | {<br/>"code": 409,<br/>"message": "Resource conflict. Please try again later."<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+1 -1
View File
@@ -10,4 +10,4 @@
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | | `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | | `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | | `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
+1 -1
View File
@@ -8,4 +8,4 @@
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | | `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
+2 -2
View File
@@ -44,7 +44,7 @@ with OpenRouter(
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | | | `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | | | `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | | `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
| `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
@@ -94,7 +94,7 @@ with OpenRouter(
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | | | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | | `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming |
| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | | `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `output_modalities` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text | | `output_modality` | *Optional[str]* | :heavy_minus_sign: | Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or "all" to include all models. Defaults to "text". | text |
| `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
-1
View File
@@ -113,6 +113,5 @@ with OpenRouter(
| ---------------------------------- | ---------------------------------- | ---------------------------------- | | ---------------------------------- | ---------------------------------- | ---------------------------------- |
| errors.BadRequestResponseError | 400 | application/json | | errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json | | errors.UnauthorizedResponseError | 401 | application/json |
| errors.ConflictResponseError | 409 | application/json |
| errors.InternalServerResponseError | 500 | application/json | | errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | | errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* |
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.9.0" version = "0.8.0"
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.9.0" __version__: str = "0.8.0"
__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.9.0 2.768.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.8.0 2.768.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
-216
View File
@@ -39,7 +39,6 @@ if TYPE_CHECKING:
ChatGenerationParams, ChatGenerationParams,
ChatGenerationParamsBy, ChatGenerationParamsBy,
ChatGenerationParamsIDAutoRouter, ChatGenerationParamsIDAutoRouter,
ChatGenerationParamsIDContextCompression,
ChatGenerationParamsIDFileParser, ChatGenerationParamsIDFileParser,
ChatGenerationParamsIDModeration, ChatGenerationParamsIDModeration,
ChatGenerationParamsIDResponseHealing, ChatGenerationParamsIDResponseHealing,
@@ -57,8 +56,6 @@ if TYPE_CHECKING:
ChatGenerationParamsPartition, ChatGenerationParamsPartition,
ChatGenerationParamsPluginAutoRouter, ChatGenerationParamsPluginAutoRouter,
ChatGenerationParamsPluginAutoRouterTypedDict, ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginContextCompression,
ChatGenerationParamsPluginContextCompressionTypedDict,
ChatGenerationParamsPluginFileParser, ChatGenerationParamsPluginFileParser,
ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginModeration, ChatGenerationParamsPluginModeration,
@@ -196,24 +193,12 @@ if TYPE_CHECKING:
CompoundFilterType, CompoundFilterType,
CompoundFilterTypedDict, CompoundFilterTypedDict,
) )
from .conflictresponseerrordata import (
ConflictResponseErrorData,
ConflictResponseErrorDataTypedDict,
)
from .contextcompressionengine import ContextCompressionEngine
from .createchargerequest import ( from .createchargerequest import (
ChainID, ChainID,
CreateChargeRequest, CreateChargeRequest,
CreateChargeRequestTypedDict, CreateChargeRequestTypedDict,
) )
from .datacollection import DataCollection from .datacollection import DataCollection
from .datetimeservertool import (
DatetimeServerTool,
DatetimeServerToolParameters,
DatetimeServerToolParametersTypedDict,
DatetimeServerToolType,
DatetimeServerToolTypedDict,
)
from .debugoptions import DebugOptions, DebugOptionsTypedDict from .debugoptions import DebugOptions, DebugOptionsTypedDict
from .defaultparameters import DefaultParameters, DefaultParametersTypedDict from .defaultparameters import DefaultParameters, DefaultParametersTypedDict
from .developermessage import ( from .developermessage import (
@@ -623,7 +608,6 @@ if TYPE_CHECKING:
from .openresponsesrequest import ( from .openresponsesrequest import (
OpenResponsesRequest, OpenResponsesRequest,
OpenResponsesRequestIDAutoRouter, OpenResponsesRequestIDAutoRouter,
OpenResponsesRequestIDContextCompression,
OpenResponsesRequestIDFileParser, OpenResponsesRequestIDFileParser,
OpenResponsesRequestIDModeration, OpenResponsesRequestIDModeration,
OpenResponsesRequestIDResponseHealing, OpenResponsesRequestIDResponseHealing,
@@ -640,8 +624,6 @@ if TYPE_CHECKING:
OpenResponsesRequestOrderTypedDict, OpenResponsesRequestOrderTypedDict,
OpenResponsesRequestPluginAutoRouter, OpenResponsesRequestPluginAutoRouter,
OpenResponsesRequestPluginAutoRouterTypedDict, OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginContextCompression,
OpenResponsesRequestPluginContextCompressionTypedDict,
OpenResponsesRequestPluginFileParser, OpenResponsesRequestPluginFileParser,
OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginModeration, OpenResponsesRequestPluginModeration,
@@ -751,46 +733,23 @@ if TYPE_CHECKING:
) )
from .openresponseswebsearch20250826tool import ( from .openresponseswebsearch20250826tool import (
OpenResponsesWebSearch20250826Tool, OpenResponsesWebSearch20250826Tool,
OpenResponsesWebSearch20250826ToolEngine,
OpenResponsesWebSearch20250826ToolFilters, OpenResponsesWebSearch20250826ToolFilters,
OpenResponsesWebSearch20250826ToolFiltersTypedDict, OpenResponsesWebSearch20250826ToolFiltersTypedDict,
OpenResponsesWebSearch20250826ToolType, OpenResponsesWebSearch20250826ToolType,
OpenResponsesWebSearch20250826ToolTypedDict, OpenResponsesWebSearch20250826ToolTypedDict,
) )
from .openresponseswebsearchcallcompleted import (
OpenResponsesWebSearchCallCompleted,
OpenResponsesWebSearchCallCompletedType,
OpenResponsesWebSearchCallCompletedTypedDict,
)
from .openresponseswebsearchcallinprogress import (
OpenResponsesWebSearchCallInProgress,
OpenResponsesWebSearchCallInProgressType,
OpenResponsesWebSearchCallInProgressTypedDict,
)
from .openresponseswebsearchcallsearching import (
OpenResponsesWebSearchCallSearching,
OpenResponsesWebSearchCallSearchingType,
OpenResponsesWebSearchCallSearchingTypedDict,
)
from .openresponseswebsearchpreview20250311tool import ( from .openresponseswebsearchpreview20250311tool import (
OpenResponsesWebSearchPreview20250311Tool, OpenResponsesWebSearchPreview20250311Tool,
OpenResponsesWebSearchPreview20250311ToolEngine,
OpenResponsesWebSearchPreview20250311ToolFilters,
OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict,
OpenResponsesWebSearchPreview20250311ToolType, OpenResponsesWebSearchPreview20250311ToolType,
OpenResponsesWebSearchPreview20250311ToolTypedDict, OpenResponsesWebSearchPreview20250311ToolTypedDict,
) )
from .openresponseswebsearchpreviewtool import ( from .openresponseswebsearchpreviewtool import (
OpenResponsesWebSearchPreviewTool, OpenResponsesWebSearchPreviewTool,
OpenResponsesWebSearchPreviewToolEngine,
OpenResponsesWebSearchPreviewToolFilters,
OpenResponsesWebSearchPreviewToolFiltersTypedDict,
OpenResponsesWebSearchPreviewToolType, OpenResponsesWebSearchPreviewToolType,
OpenResponsesWebSearchPreviewToolTypedDict, OpenResponsesWebSearchPreviewToolTypedDict,
) )
from .openresponseswebsearchtool import ( from .openresponseswebsearchtool import (
OpenResponsesWebSearchTool, OpenResponsesWebSearchTool,
OpenResponsesWebSearchToolEngine,
OpenResponsesWebSearchToolFilters, OpenResponsesWebSearchToolFilters,
OpenResponsesWebSearchToolFiltersTypedDict, OpenResponsesWebSearchToolFiltersTypedDict,
OpenResponsesWebSearchToolType, OpenResponsesWebSearchToolType,
@@ -1059,11 +1018,6 @@ if TYPE_CHECKING:
) )
from .responsesoutputmodality import ResponsesOutputModality from .responsesoutputmodality import ResponsesOutputModality
from .responsessearchcontextsize import ResponsesSearchContextSize from .responsessearchcontextsize import ResponsesSearchContextSize
from .responsesservertooloutput import (
ResponsesServerToolOutput,
ResponsesServerToolOutputStatus,
ResponsesServerToolOutputTypedDict,
)
from .responseswebsearchcalloutput import ( from .responseswebsearchcalloutput import (
Action, Action,
ActionFindInPage, ActionFindInPage,
@@ -1083,13 +1037,6 @@ if TYPE_CHECKING:
TypeURL, TypeURL,
TypeWebSearchCall, TypeWebSearchCall,
) )
from .responseswebsearchservertool import (
ResponsesWebSearchServerTool,
ResponsesWebSearchServerToolParameters,
ResponsesWebSearchServerToolParametersTypedDict,
ResponsesWebSearchServerToolType,
ResponsesWebSearchServerToolTypedDict,
)
from .responseswebsearchuserlocation import ( from .responseswebsearchuserlocation import (
ResponsesWebSearchUserLocation, ResponsesWebSearchUserLocation,
ResponsesWebSearchUserLocationType, ResponsesWebSearchUserLocationType,
@@ -1123,8 +1070,6 @@ if TYPE_CHECKING:
from .tooldefinitionjson import ( from .tooldefinitionjson import (
ToolDefinitionJSON, ToolDefinitionJSON,
ToolDefinitionJSONFunction, ToolDefinitionJSONFunction,
ToolDefinitionJSONFunctionFunction,
ToolDefinitionJSONFunctionFunctionTypedDict,
ToolDefinitionJSONFunctionTypedDict, ToolDefinitionJSONFunctionTypedDict,
ToolDefinitionJSONType, ToolDefinitionJSONType,
ToolDefinitionJSONTypedDict, ToolDefinitionJSONTypedDict,
@@ -1164,35 +1109,6 @@ if TYPE_CHECKING:
WebSearchPreviewToolUserLocationType, WebSearchPreviewToolUserLocationType,
WebSearchPreviewToolUserLocationTypedDict, WebSearchPreviewToolUserLocationTypedDict,
) )
from .websearchservertool import (
WebSearchServerTool,
WebSearchServerToolEngine,
WebSearchServerToolParameters,
WebSearchServerToolParametersType,
WebSearchServerToolParametersTypedDict,
WebSearchServerToolSearchContextSize,
WebSearchServerToolTypeOpenrouterWebSearch,
WebSearchServerToolTypedDict,
WebSearchServerToolUserLocation,
WebSearchServerToolUserLocationTypedDict,
)
from .websearchshorthand import (
WebSearchShorthand,
WebSearchShorthandEngine,
WebSearchShorthandParameters,
WebSearchShorthandParametersEngine,
WebSearchShorthandParametersSearchContextSize,
WebSearchShorthandParametersType,
WebSearchShorthandParametersTypedDict,
WebSearchShorthandParametersUserLocation,
WebSearchShorthandParametersUserLocationTypedDict,
WebSearchShorthandSearchContextSize,
WebSearchShorthandType,
WebSearchShorthandTypeApproximate,
WebSearchShorthandTypedDict,
WebSearchShorthandUserLocation,
WebSearchShorthandUserLocationTypedDict,
)
from .websearchstatus import WebSearchStatus from .websearchstatus import WebSearchStatus
__all__ = [ __all__ = [
@@ -1236,7 +1152,6 @@ __all__ = [
"ChatGenerationParams", "ChatGenerationParams",
"ChatGenerationParamsBy", "ChatGenerationParamsBy",
"ChatGenerationParamsIDAutoRouter", "ChatGenerationParamsIDAutoRouter",
"ChatGenerationParamsIDContextCompression",
"ChatGenerationParamsIDFileParser", "ChatGenerationParamsIDFileParser",
"ChatGenerationParamsIDModeration", "ChatGenerationParamsIDModeration",
"ChatGenerationParamsIDResponseHealing", "ChatGenerationParamsIDResponseHealing",
@@ -1254,8 +1169,6 @@ __all__ = [
"ChatGenerationParamsPartition", "ChatGenerationParamsPartition",
"ChatGenerationParamsPluginAutoRouter", "ChatGenerationParamsPluginAutoRouter",
"ChatGenerationParamsPluginAutoRouterTypedDict", "ChatGenerationParamsPluginAutoRouterTypedDict",
"ChatGenerationParamsPluginContextCompression",
"ChatGenerationParamsPluginContextCompressionTypedDict",
"ChatGenerationParamsPluginFileParser", "ChatGenerationParamsPluginFileParser",
"ChatGenerationParamsPluginFileParserTypedDict", "ChatGenerationParamsPluginFileParserTypedDict",
"ChatGenerationParamsPluginModeration", "ChatGenerationParamsPluginModeration",
@@ -1352,15 +1265,12 @@ __all__ = [
"CompoundFilter", "CompoundFilter",
"CompoundFilterType", "CompoundFilterType",
"CompoundFilterTypedDict", "CompoundFilterTypedDict",
"ConflictResponseErrorData",
"ConflictResponseErrorDataTypedDict",
"ConnectorID", "ConnectorID",
"Container", "Container",
"ContainerAuto", "ContainerAuto",
"ContainerAutoTypedDict", "ContainerAutoTypedDict",
"ContainerType", "ContainerType",
"ContainerTypedDict", "ContainerTypedDict",
"ContextCompressionEngine",
"CostDetails", "CostDetails",
"CostDetailsTypedDict", "CostDetailsTypedDict",
"CreateChargeRequest", "CreateChargeRequest",
@@ -1368,11 +1278,6 @@ __all__ = [
"Data", "Data",
"DataCollection", "DataCollection",
"DataTypedDict", "DataTypedDict",
"DatetimeServerTool",
"DatetimeServerToolParameters",
"DatetimeServerToolParametersTypedDict",
"DatetimeServerToolType",
"DatetimeServerToolTypedDict",
"DebugOptions", "DebugOptions",
"DebugOptionsTypedDict", "DebugOptionsTypedDict",
"DefaultParameters", "DefaultParameters",
@@ -1671,7 +1576,6 @@ __all__ = [
"OpenResponsesReasoningTypedDict", "OpenResponsesReasoningTypedDict",
"OpenResponsesRequest", "OpenResponsesRequest",
"OpenResponsesRequestIDAutoRouter", "OpenResponsesRequestIDAutoRouter",
"OpenResponsesRequestIDContextCompression",
"OpenResponsesRequestIDFileParser", "OpenResponsesRequestIDFileParser",
"OpenResponsesRequestIDModeration", "OpenResponsesRequestIDModeration",
"OpenResponsesRequestIDResponseHealing", "OpenResponsesRequestIDResponseHealing",
@@ -1688,8 +1592,6 @@ __all__ = [
"OpenResponsesRequestOrderTypedDict", "OpenResponsesRequestOrderTypedDict",
"OpenResponsesRequestPluginAutoRouter", "OpenResponsesRequestPluginAutoRouter",
"OpenResponsesRequestPluginAutoRouterTypedDict", "OpenResponsesRequestPluginAutoRouterTypedDict",
"OpenResponsesRequestPluginContextCompression",
"OpenResponsesRequestPluginContextCompressionTypedDict",
"OpenResponsesRequestPluginFileParser", "OpenResponsesRequestPluginFileParser",
"OpenResponsesRequestPluginFileParserTypedDict", "OpenResponsesRequestPluginFileParserTypedDict",
"OpenResponsesRequestPluginModeration", "OpenResponsesRequestPluginModeration",
@@ -1762,34 +1664,17 @@ __all__ = [
"OpenResponsesUsage", "OpenResponsesUsage",
"OpenResponsesUsageTypedDict", "OpenResponsesUsageTypedDict",
"OpenResponsesWebSearch20250826Tool", "OpenResponsesWebSearch20250826Tool",
"OpenResponsesWebSearch20250826ToolEngine",
"OpenResponsesWebSearch20250826ToolFilters", "OpenResponsesWebSearch20250826ToolFilters",
"OpenResponsesWebSearch20250826ToolFiltersTypedDict", "OpenResponsesWebSearch20250826ToolFiltersTypedDict",
"OpenResponsesWebSearch20250826ToolType", "OpenResponsesWebSearch20250826ToolType",
"OpenResponsesWebSearch20250826ToolTypedDict", "OpenResponsesWebSearch20250826ToolTypedDict",
"OpenResponsesWebSearchCallCompleted",
"OpenResponsesWebSearchCallCompletedType",
"OpenResponsesWebSearchCallCompletedTypedDict",
"OpenResponsesWebSearchCallInProgress",
"OpenResponsesWebSearchCallInProgressType",
"OpenResponsesWebSearchCallInProgressTypedDict",
"OpenResponsesWebSearchCallSearching",
"OpenResponsesWebSearchCallSearchingType",
"OpenResponsesWebSearchCallSearchingTypedDict",
"OpenResponsesWebSearchPreview20250311Tool", "OpenResponsesWebSearchPreview20250311Tool",
"OpenResponsesWebSearchPreview20250311ToolEngine",
"OpenResponsesWebSearchPreview20250311ToolFilters",
"OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict",
"OpenResponsesWebSearchPreview20250311ToolType", "OpenResponsesWebSearchPreview20250311ToolType",
"OpenResponsesWebSearchPreview20250311ToolTypedDict", "OpenResponsesWebSearchPreview20250311ToolTypedDict",
"OpenResponsesWebSearchPreviewTool", "OpenResponsesWebSearchPreviewTool",
"OpenResponsesWebSearchPreviewToolEngine",
"OpenResponsesWebSearchPreviewToolFilters",
"OpenResponsesWebSearchPreviewToolFiltersTypedDict",
"OpenResponsesWebSearchPreviewToolType", "OpenResponsesWebSearchPreviewToolType",
"OpenResponsesWebSearchPreviewToolTypedDict", "OpenResponsesWebSearchPreviewToolTypedDict",
"OpenResponsesWebSearchTool", "OpenResponsesWebSearchTool",
"OpenResponsesWebSearchToolEngine",
"OpenResponsesWebSearchToolFilters", "OpenResponsesWebSearchToolFilters",
"OpenResponsesWebSearchToolFiltersTypedDict", "OpenResponsesWebSearchToolFiltersTypedDict",
"OpenResponsesWebSearchToolType", "OpenResponsesWebSearchToolType",
@@ -2013,16 +1898,8 @@ __all__ = [
"ResponsesOutputMessageTypedDict", "ResponsesOutputMessageTypedDict",
"ResponsesOutputModality", "ResponsesOutputModality",
"ResponsesSearchContextSize", "ResponsesSearchContextSize",
"ResponsesServerToolOutput",
"ResponsesServerToolOutputStatus",
"ResponsesServerToolOutputTypedDict",
"ResponsesWebSearchCallOutput", "ResponsesWebSearchCallOutput",
"ResponsesWebSearchCallOutputTypedDict", "ResponsesWebSearchCallOutputTypedDict",
"ResponsesWebSearchServerTool",
"ResponsesWebSearchServerToolParameters",
"ResponsesWebSearchServerToolParametersTypedDict",
"ResponsesWebSearchServerToolType",
"ResponsesWebSearchServerToolTypedDict",
"ResponsesWebSearchUserLocation", "ResponsesWebSearchUserLocation",
"ResponsesWebSearchUserLocationType", "ResponsesWebSearchUserLocationType",
"ResponsesWebSearchUserLocationTypedDict", "ResponsesWebSearchUserLocationTypedDict",
@@ -2053,8 +1930,6 @@ __all__ = [
"ToolChoiceOptionTypedDict", "ToolChoiceOptionTypedDict",
"ToolDefinitionJSON", "ToolDefinitionJSON",
"ToolDefinitionJSONFunction", "ToolDefinitionJSONFunction",
"ToolDefinitionJSONFunctionFunction",
"ToolDefinitionJSONFunctionFunctionTypedDict",
"ToolDefinitionJSONFunctionTypedDict", "ToolDefinitionJSONFunctionTypedDict",
"ToolDefinitionJSONType", "ToolDefinitionJSONType",
"ToolDefinitionJSONTypedDict", "ToolDefinitionJSONTypedDict",
@@ -2117,31 +1992,6 @@ __all__ = [
"WebSearchPreviewToolUserLocation", "WebSearchPreviewToolUserLocation",
"WebSearchPreviewToolUserLocationType", "WebSearchPreviewToolUserLocationType",
"WebSearchPreviewToolUserLocationTypedDict", "WebSearchPreviewToolUserLocationTypedDict",
"WebSearchServerTool",
"WebSearchServerToolEngine",
"WebSearchServerToolParameters",
"WebSearchServerToolParametersType",
"WebSearchServerToolParametersTypedDict",
"WebSearchServerToolSearchContextSize",
"WebSearchServerToolTypeOpenrouterWebSearch",
"WebSearchServerToolTypedDict",
"WebSearchServerToolUserLocation",
"WebSearchServerToolUserLocationTypedDict",
"WebSearchShorthand",
"WebSearchShorthandEngine",
"WebSearchShorthandParameters",
"WebSearchShorthandParametersEngine",
"WebSearchShorthandParametersSearchContextSize",
"WebSearchShorthandParametersType",
"WebSearchShorthandParametersTypedDict",
"WebSearchShorthandParametersUserLocation",
"WebSearchShorthandParametersUserLocationTypedDict",
"WebSearchShorthandSearchContextSize",
"WebSearchShorthandType",
"WebSearchShorthandTypeApproximate",
"WebSearchShorthandTypedDict",
"WebSearchShorthandUserLocation",
"WebSearchShorthandUserLocationTypedDict",
"WebSearchStatus", "WebSearchStatus",
] ]
@@ -2169,7 +2019,6 @@ _dynamic_imports: dict[str, str] = {
"ChatGenerationParams": ".chatgenerationparams", "ChatGenerationParams": ".chatgenerationparams",
"ChatGenerationParamsBy": ".chatgenerationparams", "ChatGenerationParamsBy": ".chatgenerationparams",
"ChatGenerationParamsIDAutoRouter": ".chatgenerationparams", "ChatGenerationParamsIDAutoRouter": ".chatgenerationparams",
"ChatGenerationParamsIDContextCompression": ".chatgenerationparams",
"ChatGenerationParamsIDFileParser": ".chatgenerationparams", "ChatGenerationParamsIDFileParser": ".chatgenerationparams",
"ChatGenerationParamsIDModeration": ".chatgenerationparams", "ChatGenerationParamsIDModeration": ".chatgenerationparams",
"ChatGenerationParamsIDResponseHealing": ".chatgenerationparams", "ChatGenerationParamsIDResponseHealing": ".chatgenerationparams",
@@ -2187,8 +2036,6 @@ _dynamic_imports: dict[str, str] = {
"ChatGenerationParamsPartition": ".chatgenerationparams", "ChatGenerationParamsPartition": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams", "ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams",
"ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginContextCompression": ".chatgenerationparams",
"ChatGenerationParamsPluginContextCompressionTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParser": ".chatgenerationparams", "ChatGenerationParamsPluginFileParser": ".chatgenerationparams",
"ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams",
"ChatGenerationParamsPluginModeration": ".chatgenerationparams", "ChatGenerationParamsPluginModeration": ".chatgenerationparams",
@@ -2298,18 +2145,10 @@ _dynamic_imports: dict[str, str] = {
"CompoundFilter": ".compoundfilter", "CompoundFilter": ".compoundfilter",
"CompoundFilterType": ".compoundfilter", "CompoundFilterType": ".compoundfilter",
"CompoundFilterTypedDict": ".compoundfilter", "CompoundFilterTypedDict": ".compoundfilter",
"ConflictResponseErrorData": ".conflictresponseerrordata",
"ConflictResponseErrorDataTypedDict": ".conflictresponseerrordata",
"ContextCompressionEngine": ".contextcompressionengine",
"ChainID": ".createchargerequest", "ChainID": ".createchargerequest",
"CreateChargeRequest": ".createchargerequest", "CreateChargeRequest": ".createchargerequest",
"CreateChargeRequestTypedDict": ".createchargerequest", "CreateChargeRequestTypedDict": ".createchargerequest",
"DataCollection": ".datacollection", "DataCollection": ".datacollection",
"DatetimeServerTool": ".datetimeservertool",
"DatetimeServerToolParameters": ".datetimeservertool",
"DatetimeServerToolParametersTypedDict": ".datetimeservertool",
"DatetimeServerToolType": ".datetimeservertool",
"DatetimeServerToolTypedDict": ".datetimeservertool",
"DebugOptions": ".debugoptions", "DebugOptions": ".debugoptions",
"DebugOptionsTypedDict": ".debugoptions", "DebugOptionsTypedDict": ".debugoptions",
"DefaultParameters": ".defaultparameters", "DefaultParameters": ".defaultparameters",
@@ -2642,7 +2481,6 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent",
"OpenResponsesRequest": ".openresponsesrequest", "OpenResponsesRequest": ".openresponsesrequest",
"OpenResponsesRequestIDAutoRouter": ".openresponsesrequest", "OpenResponsesRequestIDAutoRouter": ".openresponsesrequest",
"OpenResponsesRequestIDContextCompression": ".openresponsesrequest",
"OpenResponsesRequestIDFileParser": ".openresponsesrequest", "OpenResponsesRequestIDFileParser": ".openresponsesrequest",
"OpenResponsesRequestIDModeration": ".openresponsesrequest", "OpenResponsesRequestIDModeration": ".openresponsesrequest",
"OpenResponsesRequestIDResponseHealing": ".openresponsesrequest", "OpenResponsesRequestIDResponseHealing": ".openresponsesrequest",
@@ -2659,8 +2497,6 @@ _dynamic_imports: dict[str, str] = {
"OpenResponsesRequestOrderTypedDict": ".openresponsesrequest", "OpenResponsesRequestOrderTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest", "OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest",
"OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginContextCompression": ".openresponsesrequest",
"OpenResponsesRequestPluginContextCompressionTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParser": ".openresponsesrequest", "OpenResponsesRequestPluginFileParser": ".openresponsesrequest",
"OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest",
"OpenResponsesRequestPluginModeration": ".openresponsesrequest", "OpenResponsesRequestPluginModeration": ".openresponsesrequest",
@@ -2762,34 +2598,17 @@ _dynamic_imports: dict[str, str] = {
"OutputTokensDetails": ".openresponsesusage", "OutputTokensDetails": ".openresponsesusage",
"OutputTokensDetailsTypedDict": ".openresponsesusage", "OutputTokensDetailsTypedDict": ".openresponsesusage",
"OpenResponsesWebSearch20250826Tool": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826Tool": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearch20250826ToolEngine": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearch20250826ToolFilters": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolFilters": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearch20250826ToolFiltersTypedDict": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolFiltersTypedDict": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearch20250826ToolType": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolType": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearch20250826ToolTypedDict": ".openresponseswebsearch20250826tool", "OpenResponsesWebSearch20250826ToolTypedDict": ".openresponseswebsearch20250826tool",
"OpenResponsesWebSearchCallCompleted": ".openresponseswebsearchcallcompleted",
"OpenResponsesWebSearchCallCompletedType": ".openresponseswebsearchcallcompleted",
"OpenResponsesWebSearchCallCompletedTypedDict": ".openresponseswebsearchcallcompleted",
"OpenResponsesWebSearchCallInProgress": ".openresponseswebsearchcallinprogress",
"OpenResponsesWebSearchCallInProgressType": ".openresponseswebsearchcallinprogress",
"OpenResponsesWebSearchCallInProgressTypedDict": ".openresponseswebsearchcallinprogress",
"OpenResponsesWebSearchCallSearching": ".openresponseswebsearchcallsearching",
"OpenResponsesWebSearchCallSearchingType": ".openresponseswebsearchcallsearching",
"OpenResponsesWebSearchCallSearchingTypedDict": ".openresponseswebsearchcallsearching",
"OpenResponsesWebSearchPreview20250311Tool": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreview20250311Tool": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreview20250311ToolEngine": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreview20250311ToolFilters": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreview20250311ToolType": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreview20250311ToolType": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreview20250311ToolTypedDict": ".openresponseswebsearchpreview20250311tool", "OpenResponsesWebSearchPreview20250311ToolTypedDict": ".openresponseswebsearchpreview20250311tool",
"OpenResponsesWebSearchPreviewTool": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchPreviewTool": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchPreviewToolEngine": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchPreviewToolFilters": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchPreviewToolFiltersTypedDict": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchPreviewToolType": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchPreviewToolType": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchPreviewToolTypedDict": ".openresponseswebsearchpreviewtool", "OpenResponsesWebSearchPreviewToolTypedDict": ".openresponseswebsearchpreviewtool",
"OpenResponsesWebSearchTool": ".openresponseswebsearchtool", "OpenResponsesWebSearchTool": ".openresponseswebsearchtool",
"OpenResponsesWebSearchToolEngine": ".openresponseswebsearchtool",
"OpenResponsesWebSearchToolFilters": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolFilters": ".openresponseswebsearchtool",
"OpenResponsesWebSearchToolFiltersTypedDict": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolFiltersTypedDict": ".openresponseswebsearchtool",
"OpenResponsesWebSearchToolType": ".openresponseswebsearchtool", "OpenResponsesWebSearchToolType": ".openresponseswebsearchtool",
@@ -2987,9 +2806,6 @@ _dynamic_imports: dict[str, str] = {
"ResponsesOutputMessageTypedDict": ".responsesoutputmessage", "ResponsesOutputMessageTypedDict": ".responsesoutputmessage",
"ResponsesOutputModality": ".responsesoutputmodality", "ResponsesOutputModality": ".responsesoutputmodality",
"ResponsesSearchContextSize": ".responsessearchcontextsize", "ResponsesSearchContextSize": ".responsessearchcontextsize",
"ResponsesServerToolOutput": ".responsesservertooloutput",
"ResponsesServerToolOutputStatus": ".responsesservertooloutput",
"ResponsesServerToolOutputTypedDict": ".responsesservertooloutput",
"Action": ".responseswebsearchcalloutput", "Action": ".responseswebsearchcalloutput",
"ActionFindInPage": ".responseswebsearchcalloutput", "ActionFindInPage": ".responseswebsearchcalloutput",
"ActionFindInPageTypedDict": ".responseswebsearchcalloutput", "ActionFindInPageTypedDict": ".responseswebsearchcalloutput",
@@ -3007,11 +2823,6 @@ _dynamic_imports: dict[str, str] = {
"TypeSearch": ".responseswebsearchcalloutput", "TypeSearch": ".responseswebsearchcalloutput",
"TypeURL": ".responseswebsearchcalloutput", "TypeURL": ".responseswebsearchcalloutput",
"TypeWebSearchCall": ".responseswebsearchcalloutput", "TypeWebSearchCall": ".responseswebsearchcalloutput",
"ResponsesWebSearchServerTool": ".responseswebsearchservertool",
"ResponsesWebSearchServerToolParameters": ".responseswebsearchservertool",
"ResponsesWebSearchServerToolParametersTypedDict": ".responseswebsearchservertool",
"ResponsesWebSearchServerToolType": ".responseswebsearchservertool",
"ResponsesWebSearchServerToolTypedDict": ".responseswebsearchservertool",
"ResponsesWebSearchUserLocation": ".responseswebsearchuserlocation", "ResponsesWebSearchUserLocation": ".responseswebsearchuserlocation",
"ResponsesWebSearchUserLocationType": ".responseswebsearchuserlocation", "ResponsesWebSearchUserLocationType": ".responseswebsearchuserlocation",
"ResponsesWebSearchUserLocationTypedDict": ".responseswebsearchuserlocation", "ResponsesWebSearchUserLocationTypedDict": ".responseswebsearchuserlocation",
@@ -3035,8 +2846,6 @@ _dynamic_imports: dict[str, str] = {
"ToolChoiceOptionTypedDict": ".toolchoiceoption", "ToolChoiceOptionTypedDict": ".toolchoiceoption",
"ToolDefinitionJSON": ".tooldefinitionjson", "ToolDefinitionJSON": ".tooldefinitionjson",
"ToolDefinitionJSONFunction": ".tooldefinitionjson", "ToolDefinitionJSONFunction": ".tooldefinitionjson",
"ToolDefinitionJSONFunctionFunction": ".tooldefinitionjson",
"ToolDefinitionJSONFunctionFunctionTypedDict": ".tooldefinitionjson",
"ToolDefinitionJSONFunctionTypedDict": ".tooldefinitionjson", "ToolDefinitionJSONFunctionTypedDict": ".tooldefinitionjson",
"ToolDefinitionJSONType": ".tooldefinitionjson", "ToolDefinitionJSONType": ".tooldefinitionjson",
"ToolDefinitionJSONTypedDict": ".tooldefinitionjson", "ToolDefinitionJSONTypedDict": ".tooldefinitionjson",
@@ -3067,31 +2876,6 @@ _dynamic_imports: dict[str, str] = {
"WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation",
"WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation",
"WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation",
"WebSearchServerTool": ".websearchservertool",
"WebSearchServerToolEngine": ".websearchservertool",
"WebSearchServerToolParameters": ".websearchservertool",
"WebSearchServerToolParametersType": ".websearchservertool",
"WebSearchServerToolParametersTypedDict": ".websearchservertool",
"WebSearchServerToolSearchContextSize": ".websearchservertool",
"WebSearchServerToolTypeOpenrouterWebSearch": ".websearchservertool",
"WebSearchServerToolTypedDict": ".websearchservertool",
"WebSearchServerToolUserLocation": ".websearchservertool",
"WebSearchServerToolUserLocationTypedDict": ".websearchservertool",
"WebSearchShorthand": ".websearchshorthand",
"WebSearchShorthandEngine": ".websearchshorthand",
"WebSearchShorthandParameters": ".websearchshorthand",
"WebSearchShorthandParametersEngine": ".websearchshorthand",
"WebSearchShorthandParametersSearchContextSize": ".websearchshorthand",
"WebSearchShorthandParametersType": ".websearchshorthand",
"WebSearchShorthandParametersTypedDict": ".websearchshorthand",
"WebSearchShorthandParametersUserLocation": ".websearchshorthand",
"WebSearchShorthandParametersUserLocationTypedDict": ".websearchshorthand",
"WebSearchShorthandSearchContextSize": ".websearchshorthand",
"WebSearchShorthandType": ".websearchshorthand",
"WebSearchShorthandTypeApproximate": ".websearchshorthand",
"WebSearchShorthandTypedDict": ".websearchshorthand",
"WebSearchShorthandUserLocation": ".websearchshorthand",
"WebSearchShorthandUserLocationTypedDict": ".websearchshorthand",
"WebSearchStatus": ".websearchstatus", "WebSearchStatus": ".websearchstatus",
} }
@@ -2,7 +2,6 @@
from __future__ import annotations from __future__ import annotations
from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict
from .contextcompressionengine import ContextCompressionEngine
from .datacollection import DataCollection from .datacollection import DataCollection
from .debugoptions import DebugOptions, DebugOptionsTypedDict from .debugoptions import DebugOptions, DebugOptionsTypedDict
from .message import Message, MessageTypedDict from .message import Message, MessageTypedDict
@@ -406,27 +405,6 @@ class ChatGenerationParamsProvider(BaseModel):
return m return m
ChatGenerationParamsIDContextCompression = Literal["context-compression",]
class ChatGenerationParamsPluginContextCompressionTypedDict(TypedDict):
id: ChatGenerationParamsIDContextCompression
enabled: NotRequired[bool]
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
engine: NotRequired[ContextCompressionEngine]
r"""The compression engine to use. Defaults to \"middle-out\"."""
class ChatGenerationParamsPluginContextCompression(BaseModel):
id: ChatGenerationParamsIDContextCompression
enabled: Optional[bool] = None
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
engine: Optional[ContextCompressionEngine] = None
r"""The compression engine to use. Defaults to \"middle-out\"."""
ChatGenerationParamsIDResponseHealing = Literal["response-healing",] ChatGenerationParamsIDResponseHealing = Literal["response-healing",]
@@ -542,7 +520,6 @@ ChatGenerationParamsPluginUnionTypedDict = TypeAliasType(
ChatGenerationParamsPluginResponseHealingTypedDict, ChatGenerationParamsPluginResponseHealingTypedDict,
ChatGenerationParamsPluginAutoRouterTypedDict, ChatGenerationParamsPluginAutoRouterTypedDict,
ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginFileParserTypedDict,
ChatGenerationParamsPluginContextCompressionTypedDict,
ChatGenerationParamsPluginWebTypedDict, ChatGenerationParamsPluginWebTypedDict,
], ],
) )
@@ -555,9 +532,6 @@ ChatGenerationParamsPluginUnion = Annotated[
Annotated[ChatGenerationParamsPluginWeb, Tag("web")], Annotated[ChatGenerationParamsPluginWeb, Tag("web")],
Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")], Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")],
Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")], Annotated[ChatGenerationParamsPluginResponseHealing, Tag("response-healing")],
Annotated[
ChatGenerationParamsPluginContextCompression, Tag("context-compression")
],
], ],
Discriminator(lambda m: get_discriminator(m, "id", "id")), Discriminator(lambda m: get_discriminator(m, "id", "id")),
] ]
@@ -1,61 +0,0 @@
"""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 import Any, Dict
from typing_extensions import NotRequired, TypedDict
class ConflictResponseErrorDataTypedDict(TypedDict):
r"""Error data for ConflictResponse"""
code: int
message: str
metadata: NotRequired[Nullable[Dict[str, Nullable[Any]]]]
class ConflictResponseErrorData(BaseModel):
r"""Error data for ConflictResponse"""
code: int
message: str
metadata: OptionalNullable[Dict[str, Nullable[Any]]] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["metadata"]
nullable_fields = ["metadata"]
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
@@ -1,8 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from typing import Literal
ContextCompressionEngine = Literal["middle-out",]
r"""The compression engine to use. Defaults to \"middle-out\"."""
@@ -1,34 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
DatetimeServerToolType = Literal["openrouter:datetime",]
class DatetimeServerToolParametersTypedDict(TypedDict):
timezone: NotRequired[str]
r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC."""
class DatetimeServerToolParameters(BaseModel):
timezone: Optional[str] = None
r"""IANA timezone name (e.g. \"America/New_York\"). Defaults to UTC."""
class DatetimeServerToolTypedDict(TypedDict):
r"""OpenRouter built-in server tool: returns the current date and time"""
type: DatetimeServerToolType
parameters: NotRequired[DatetimeServerToolParametersTypedDict]
class DatetimeServerTool(BaseModel):
r"""OpenRouter built-in server tool: returns the current date and time"""
type: DatetimeServerToolType
parameters: Optional[DatetimeServerToolParameters] = None
@@ -40,10 +40,6 @@ from .responsesoutputitemfunctioncall import (
ResponsesOutputItemFunctionCall, ResponsesOutputItemFunctionCall,
ResponsesOutputItemFunctionCallTypedDict, ResponsesOutputItemFunctionCallTypedDict,
) )
from .responsesservertooloutput import (
ResponsesServerToolOutput,
ResponsesServerToolOutputTypedDict,
)
from .responseswebsearchcalloutput import ( from .responseswebsearchcalloutput import (
ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput,
ResponsesWebSearchCallOutputTypedDict, ResponsesWebSearchCallOutputTypedDict,
@@ -343,7 +339,6 @@ OpenResponsesInputUnion1TypedDict = TypeAliasType(
ResponsesWebSearchCallOutputTypedDict, ResponsesWebSearchCallOutputTypedDict,
ResponsesOutputItemFileSearchCallTypedDict, ResponsesOutputItemFileSearchCallTypedDict,
ResponsesImageGenerationCallTypedDict, ResponsesImageGenerationCallTypedDict,
ResponsesServerToolOutputTypedDict,
OpenResponsesFunctionCallOutputTypedDict, OpenResponsesFunctionCallOutputTypedDict,
OpenResponsesFunctionToolCallTypedDict, OpenResponsesFunctionToolCallTypedDict,
OpenResponsesInputMessageTypedDict, OpenResponsesInputMessageTypedDict,
@@ -362,7 +357,6 @@ OpenResponsesInputUnion1 = TypeAliasType(
ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput,
ResponsesOutputItemFileSearchCall, ResponsesOutputItemFileSearchCall,
ResponsesImageGenerationCall, ResponsesImageGenerationCall,
ResponsesServerToolOutput,
OpenResponsesFunctionCallOutput, OpenResponsesFunctionCallOutput,
OpenResponsesFunctionToolCall, OpenResponsesFunctionToolCall,
OpenResponsesInputMessage, OpenResponsesInputMessage,
@@ -151,18 +151,18 @@ class OpenResponsesNonStreamingResponseToolFunction(BaseModel):
OpenResponsesNonStreamingResponseToolUnionTypedDict = TypeAliasType( OpenResponsesNonStreamingResponseToolUnionTypedDict = TypeAliasType(
"OpenResponsesNonStreamingResponseToolUnionTypedDict", "OpenResponsesNonStreamingResponseToolUnionTypedDict",
Union[ Union[
OpenResponsesLocalShellToolTypedDict,
OpenResponsesApplyPatchToolTypedDict, OpenResponsesApplyPatchToolTypedDict,
OpenResponsesFunctionShellToolTypedDict, OpenResponsesFunctionShellToolTypedDict,
OpenResponsesLocalShellToolTypedDict,
OpenResponsesCodeInterpreterToolTypedDict, OpenResponsesCodeInterpreterToolTypedDict,
OpenResponsesCustomToolTypedDict, OpenResponsesWebSearchPreviewToolTypedDict,
OpenResponsesWebSearchPreview20250311ToolTypedDict,
OpenResponsesComputerToolTypedDict, OpenResponsesComputerToolTypedDict,
OpenResponsesWebSearch20250826ToolTypedDict,
OpenResponsesWebSearchToolTypedDict,
OpenResponsesCustomToolTypedDict,
OpenResponsesNonStreamingResponseToolFunctionTypedDict, OpenResponsesNonStreamingResponseToolFunctionTypedDict,
OpenResponsesFileSearchToolTypedDict, OpenResponsesFileSearchToolTypedDict,
OpenResponsesWebSearchToolTypedDict,
OpenResponsesWebSearch20250826ToolTypedDict,
OpenResponsesWebSearchPreview20250311ToolTypedDict,
OpenResponsesWebSearchPreviewToolTypedDict,
OpenResponsesMcpToolTypedDict, OpenResponsesMcpToolTypedDict,
OpenResponsesImageGenerationToolTypedDict, OpenResponsesImageGenerationToolTypedDict,
], ],
@@ -1,9 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from .contextcompressionengine import ContextCompressionEngine
from .datacollection import DataCollection from .datacollection import DataCollection
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
from .openairesponsesincludable import OpenAIResponsesIncludable from .openairesponsesincludable import OpenAIResponsesIncludable
from .openairesponsesprompt import OpenAIResponsesPrompt, OpenAIResponsesPromptTypedDict from .openairesponsesprompt import OpenAIResponsesPrompt, OpenAIResponsesPromptTypedDict
from .openairesponsestoolchoice_union import ( from .openairesponsestoolchoice_union import (
@@ -82,10 +80,6 @@ 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 .responsesoutputmodality import ResponsesOutputModality
from .responseswebsearchservertool import (
ResponsesWebSearchServerTool,
ResponsesWebSearchServerToolTypedDict,
)
from .websearchengine import WebSearchEngine from .websearchengine import WebSearchEngine
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
@@ -163,20 +157,18 @@ class OpenResponsesRequestToolFunction(BaseModel):
OpenResponsesRequestToolUnionTypedDict = TypeAliasType( OpenResponsesRequestToolUnionTypedDict = TypeAliasType(
"OpenResponsesRequestToolUnionTypedDict", "OpenResponsesRequestToolUnionTypedDict",
Union[ Union[
OpenResponsesLocalShellToolTypedDict,
OpenResponsesApplyPatchToolTypedDict, OpenResponsesApplyPatchToolTypedDict,
OpenResponsesFunctionShellToolTypedDict, OpenResponsesFunctionShellToolTypedDict,
ResponsesWebSearchServerToolTypedDict, OpenResponsesLocalShellToolTypedDict,
DatetimeServerToolTypedDict,
OpenResponsesCodeInterpreterToolTypedDict, OpenResponsesCodeInterpreterToolTypedDict,
OpenResponsesCustomToolTypedDict, OpenResponsesWebSearchPreviewToolTypedDict,
OpenResponsesWebSearchPreview20250311ToolTypedDict,
OpenResponsesComputerToolTypedDict, OpenResponsesComputerToolTypedDict,
OpenResponsesRequestToolFunctionTypedDict,
OpenResponsesFileSearchToolTypedDict,
OpenResponsesWebSearch20250826ToolTypedDict, OpenResponsesWebSearch20250826ToolTypedDict,
OpenResponsesWebSearchToolTypedDict, OpenResponsesWebSearchToolTypedDict,
OpenResponsesWebSearchPreview20250311ToolTypedDict, OpenResponsesCustomToolTypedDict,
OpenResponsesWebSearchPreviewToolTypedDict, OpenResponsesRequestToolFunctionTypedDict,
OpenResponsesFileSearchToolTypedDict,
OpenResponsesMcpToolTypedDict, OpenResponsesMcpToolTypedDict,
OpenResponsesImageGenerationToolTypedDict, OpenResponsesImageGenerationToolTypedDict,
], ],
@@ -202,8 +194,6 @@ OpenResponsesRequestToolUnion = Annotated[
Annotated[OpenResponsesFunctionShellTool, Tag("shell")], Annotated[OpenResponsesFunctionShellTool, Tag("shell")],
Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")], Annotated[OpenResponsesApplyPatchTool, Tag("apply_patch")],
Annotated[OpenResponsesCustomTool, Tag("custom")], Annotated[OpenResponsesCustomTool, Tag("custom")],
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
Annotated[ResponsesWebSearchServerTool, Tag("openrouter:web_search")],
], ],
Discriminator(lambda m: get_discriminator(m, "type", "type")), Discriminator(lambda m: get_discriminator(m, "type", "type")),
] ]
@@ -459,27 +449,6 @@ class OpenResponsesRequestProvider(BaseModel):
return m return m
OpenResponsesRequestIDContextCompression = Literal["context-compression",]
class OpenResponsesRequestPluginContextCompressionTypedDict(TypedDict):
id: OpenResponsesRequestIDContextCompression
enabled: NotRequired[bool]
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
engine: NotRequired[ContextCompressionEngine]
r"""The compression engine to use. Defaults to \"middle-out\"."""
class OpenResponsesRequestPluginContextCompression(BaseModel):
id: OpenResponsesRequestIDContextCompression
enabled: Optional[bool] = None
r"""Set to false to disable the context-compression plugin for this request. Defaults to true."""
engine: Optional[ContextCompressionEngine] = None
r"""The compression engine to use. Defaults to \"middle-out\"."""
OpenResponsesRequestIDResponseHealing = Literal["response-healing",] OpenResponsesRequestIDResponseHealing = Literal["response-healing",]
@@ -595,7 +564,6 @@ OpenResponsesRequestPluginUnionTypedDict = TypeAliasType(
OpenResponsesRequestPluginResponseHealingTypedDict, OpenResponsesRequestPluginResponseHealingTypedDict,
OpenResponsesRequestPluginAutoRouterTypedDict, OpenResponsesRequestPluginAutoRouterTypedDict,
OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginFileParserTypedDict,
OpenResponsesRequestPluginContextCompressionTypedDict,
OpenResponsesRequestPluginWebTypedDict, OpenResponsesRequestPluginWebTypedDict,
], ],
) )
@@ -608,9 +576,6 @@ OpenResponsesRequestPluginUnion = Annotated[
Annotated[OpenResponsesRequestPluginWeb, Tag("web")], Annotated[OpenResponsesRequestPluginWeb, Tag("web")],
Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")], Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")],
Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")], Annotated[OpenResponsesRequestPluginResponseHealing, Tag("response-healing")],
Annotated[
OpenResponsesRequestPluginContextCompression, Tag("context-compression")
],
], ],
Discriminator(lambda m: get_discriminator(m, "id", "id")), Discriminator(lambda m: get_discriminator(m, "id", "id")),
] ]
@@ -53,18 +53,6 @@ from .openresponsesreasoningsummarytextdoneevent import (
OpenResponsesReasoningSummaryTextDoneEvent, OpenResponsesReasoningSummaryTextDoneEvent,
OpenResponsesReasoningSummaryTextDoneEventTypedDict, OpenResponsesReasoningSummaryTextDoneEventTypedDict,
) )
from .openresponseswebsearchcallcompleted import (
OpenResponsesWebSearchCallCompleted,
OpenResponsesWebSearchCallCompletedTypedDict,
)
from .openresponseswebsearchcallinprogress import (
OpenResponsesWebSearchCallInProgress,
OpenResponsesWebSearchCallInProgressTypedDict,
)
from .openresponseswebsearchcallsearching import (
OpenResponsesWebSearchCallSearching,
OpenResponsesWebSearchCallSearchingTypedDict,
)
from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict
from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict
from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict from .responseoutputtext import ResponseOutputText, ResponseOutputTextTypedDict
@@ -684,25 +672,22 @@ OpenResponsesStreamEventTypedDict = TypeAliasType(
OpenResponsesStreamEventResponseFailedTypedDict, OpenResponsesStreamEventResponseFailedTypedDict,
OpenResponsesStreamEventResponseOutputItemAddedTypedDict, OpenResponsesStreamEventResponseOutputItemAddedTypedDict,
OpenResponsesStreamEventResponseOutputItemDoneTypedDict, OpenResponsesStreamEventResponseOutputItemDoneTypedDict,
OpenResponsesWebSearchCallCompletedTypedDict,
OpenResponsesWebSearchCallSearchingTypedDict,
OpenResponsesWebSearchCallInProgressTypedDict,
OpenResponsesImageGenCallCompletedTypedDict, OpenResponsesImageGenCallCompletedTypedDict,
OpenResponsesImageGenCallGeneratingTypedDict, OpenResponsesImageGenCallGeneratingTypedDict,
OpenResponsesImageGenCallInProgressTypedDict, OpenResponsesImageGenCallInProgressTypedDict,
OpenResponsesStreamEventResponseFunctionCallArgumentsDeltaTypedDict,
OpenResponsesErrorEventTypedDict, OpenResponsesErrorEventTypedDict,
OpenResponsesReasoningSummaryTextDeltaEventTypedDict, OpenResponsesStreamEventResponseFunctionCallArgumentsDeltaTypedDict,
OpenResponsesReasoningSummaryTextDoneEventTypedDict, OpenResponsesStreamEventResponseRefusalDeltaTypedDict,
OpenResponsesReasoningSummaryPartAddedEventTypedDict,
OpenResponsesStreamEventResponseContentPartAddedTypedDict,
OpenResponsesImageGenCallPartialImageTypedDict,
OpenResponsesStreamEventResponseFunctionCallArgumentsDoneTypedDict,
OpenResponsesReasoningDeltaEventTypedDict, OpenResponsesReasoningDeltaEventTypedDict,
OpenResponsesReasoningDoneEventTypedDict, OpenResponsesReasoningDoneEventTypedDict,
OpenResponsesReasoningSummaryPartAddedEventTypedDict,
OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict,
OpenResponsesStreamEventResponseContentPartAddedTypedDict,
OpenResponsesStreamEventResponseFunctionCallArgumentsDoneTypedDict,
OpenResponsesStreamEventResponseRefusalDoneTypedDict, OpenResponsesStreamEventResponseRefusalDoneTypedDict,
OpenResponsesStreamEventResponseRefusalDeltaTypedDict, OpenResponsesStreamEventResponseReasoningSummaryPartDoneTypedDict,
OpenResponsesImageGenCallPartialImageTypedDict, OpenResponsesReasoningSummaryTextDeltaEventTypedDict,
OpenResponsesReasoningSummaryTextDoneEventTypedDict,
OpenResponsesStreamEventResponseContentPartDoneTypedDict, OpenResponsesStreamEventResponseContentPartDoneTypedDict,
OpenResponsesStreamEventResponseOutputTextDeltaTypedDict, OpenResponsesStreamEventResponseOutputTextDeltaTypedDict,
OpenResponsesStreamEventResponseOutputTextDoneTypedDict, OpenResponsesStreamEventResponseOutputTextDoneTypedDict,
@@ -802,18 +787,6 @@ OpenResponsesStreamEvent = Annotated[
OpenResponsesImageGenCallCompleted, OpenResponsesImageGenCallCompleted,
Tag("response.image_generation_call.completed"), Tag("response.image_generation_call.completed"),
], ],
Annotated[
OpenResponsesWebSearchCallInProgress,
Tag("response.web_search_call.in_progress"),
],
Annotated[
OpenResponsesWebSearchCallSearching,
Tag("response.web_search_call.searching"),
],
Annotated[
OpenResponsesWebSearchCallCompleted,
Tag("response.web_search_call.completed"),
],
], ],
Discriminator(lambda m: get_discriminator(m, "type", "type")), Discriminator(lambda m: get_discriminator(m, "type", "type")),
] ]
@@ -12,12 +12,11 @@ from openrouter.types import (
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
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
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
@@ -26,18 +25,15 @@ OpenResponsesWebSearch20250826ToolType = Literal["web_search_2025_08_26",]
class OpenResponsesWebSearch20250826ToolFiltersTypedDict(TypedDict): class OpenResponsesWebSearch20250826ToolFiltersTypedDict(TypedDict):
allowed_domains: NotRequired[Nullable[List[str]]] allowed_domains: NotRequired[Nullable[List[str]]]
excluded_domains: NotRequired[Nullable[List[str]]]
class OpenResponsesWebSearch20250826ToolFilters(BaseModel): class OpenResponsesWebSearch20250826ToolFilters(BaseModel):
allowed_domains: OptionalNullable[List[str]] = UNSET allowed_domains: OptionalNullable[List[str]] = UNSET
excluded_domains: OptionalNullable[List[str]] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = ["allowed_domains", "excluded_domains"] optional_fields = ["allowed_domains"]
nullable_fields = ["allowed_domains", "excluded_domains"] nullable_fields = ["allowed_domains"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) serialized = handler(self)
@@ -65,17 +61,6 @@ class OpenResponsesWebSearch20250826ToolFilters(BaseModel):
return m return m
OpenResponsesWebSearch20250826ToolEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict): class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict):
r"""Web search tool configuration (2025-08-26 version)""" r"""Web search tool configuration (2025-08-26 version)"""
@@ -85,10 +70,6 @@ class OpenResponsesWebSearch20250826ToolTypedDict(TypedDict):
r"""Size of the search context for web search tools""" r"""Size of the search context for web search tools"""
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]] user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
r"""User location information for web search""" r"""User location information for web search"""
engine: NotRequired[OpenResponsesWebSearch20250826ToolEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
class OpenResponsesWebSearch20250826Tool(BaseModel): class OpenResponsesWebSearch20250826Tool(BaseModel):
@@ -106,24 +87,9 @@ class OpenResponsesWebSearch20250826Tool(BaseModel):
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
r"""User location information for web search""" r"""User location information for web search"""
engine: Annotated[
Optional[OpenResponsesWebSearch20250826ToolEngine],
PlainValidator(validate_open_enum(False)),
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = ["filters", "search_context_size", "user_location"]
"filters",
"search_context_size",
"user_location",
"engine",
"max_results",
]
nullable_fields = ["filters", "user_location"] nullable_fields = ["filters", "user_location"]
null_default_fields = [] null_default_fields = []
@@ -1,30 +0,0 @@
"""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
OpenResponsesWebSearchCallCompletedType = Literal["response.web_search_call.completed",]
class OpenResponsesWebSearchCallCompletedTypedDict(TypedDict):
r"""Web search call completed"""
type: OpenResponsesWebSearchCallCompletedType
item_id: str
output_index: float
sequence_number: float
class OpenResponsesWebSearchCallCompleted(BaseModel):
r"""Web search call completed"""
type: OpenResponsesWebSearchCallCompletedType
item_id: str
output_index: float
sequence_number: float
@@ -1,32 +0,0 @@
"""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
OpenResponsesWebSearchCallInProgressType = Literal[
"response.web_search_call.in_progress",
]
class OpenResponsesWebSearchCallInProgressTypedDict(TypedDict):
r"""Web search call in progress"""
type: OpenResponsesWebSearchCallInProgressType
item_id: str
output_index: float
sequence_number: float
class OpenResponsesWebSearchCallInProgress(BaseModel):
r"""Web search call in progress"""
type: OpenResponsesWebSearchCallInProgressType
item_id: str
output_index: float
sequence_number: float
@@ -1,30 +0,0 @@
"""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
OpenResponsesWebSearchCallSearchingType = Literal["response.web_search_call.searching",]
class OpenResponsesWebSearchCallSearchingTypedDict(TypedDict):
r"""Web search call is searching"""
type: OpenResponsesWebSearchCallSearchingType
item_id: str
output_index: float
sequence_number: float
class OpenResponsesWebSearchCallSearching(BaseModel):
r"""Web search call is searching"""
type: OpenResponsesWebSearchCallSearchingType
item_id: str
output_index: float
sequence_number: float
@@ -12,12 +12,11 @@ from openrouter.types import (
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
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 Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
@@ -26,58 +25,6 @@ OpenResponsesWebSearchPreview20250311ToolType = Literal[
] ]
OpenResponsesWebSearchPreview20250311ToolEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
class OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict(TypedDict):
allowed_domains: NotRequired[Nullable[List[str]]]
excluded_domains: NotRequired[Nullable[List[str]]]
class OpenResponsesWebSearchPreview20250311ToolFilters(BaseModel):
allowed_domains: OptionalNullable[List[str]] = UNSET
excluded_domains: OptionalNullable[List[str]] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["allowed_domains", "excluded_domains"]
nullable_fields = ["allowed_domains", "excluded_domains"]
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
class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict): class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict):
r"""Web search preview tool configuration (2025-03-11 version)""" r"""Web search preview tool configuration (2025-03-11 version)"""
@@ -85,13 +32,6 @@ class OpenResponsesWebSearchPreview20250311ToolTypedDict(TypedDict):
search_context_size: NotRequired[ResponsesSearchContextSize] search_context_size: NotRequired[ResponsesSearchContextSize]
r"""Size of the search context for web search tools""" r"""Size of the search context for web search tools"""
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]] user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
engine: NotRequired[OpenResponsesWebSearchPreview20250311ToolEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
filters: NotRequired[
Nullable[OpenResponsesWebSearchPreview20250311ToolFiltersTypedDict]
]
class OpenResponsesWebSearchPreview20250311Tool(BaseModel): class OpenResponsesWebSearchPreview20250311Tool(BaseModel):
@@ -106,27 +46,10 @@ class OpenResponsesWebSearchPreview20250311Tool(BaseModel):
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
engine: Annotated[
Optional[OpenResponsesWebSearchPreview20250311ToolEngine],
PlainValidator(validate_open_enum(False)),
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
filters: OptionalNullable[OpenResponsesWebSearchPreview20250311ToolFilters] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = ["search_context_size", "user_location"]
"search_context_size", nullable_fields = ["user_location"]
"user_location",
"engine",
"max_results",
"filters",
]
nullable_fields = ["user_location", "filters"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) serialized = handler(self)
@@ -12,70 +12,17 @@ from openrouter.types import (
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
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 Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
OpenResponsesWebSearchPreviewToolType = Literal["web_search_preview",] OpenResponsesWebSearchPreviewToolType = Literal["web_search_preview",]
OpenResponsesWebSearchPreviewToolEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
class OpenResponsesWebSearchPreviewToolFiltersTypedDict(TypedDict):
allowed_domains: NotRequired[Nullable[List[str]]]
excluded_domains: NotRequired[Nullable[List[str]]]
class OpenResponsesWebSearchPreviewToolFilters(BaseModel):
allowed_domains: OptionalNullable[List[str]] = UNSET
excluded_domains: OptionalNullable[List[str]] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["allowed_domains", "excluded_domains"]
nullable_fields = ["allowed_domains", "excluded_domains"]
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
class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict): class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict):
r"""Web search preview tool configuration""" r"""Web search preview tool configuration"""
@@ -83,11 +30,6 @@ class OpenResponsesWebSearchPreviewToolTypedDict(TypedDict):
search_context_size: NotRequired[ResponsesSearchContextSize] search_context_size: NotRequired[ResponsesSearchContextSize]
r"""Size of the search context for web search tools""" r"""Size of the search context for web search tools"""
user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]] user_location: NotRequired[Nullable[WebSearchPreviewToolUserLocationTypedDict]]
engine: NotRequired[OpenResponsesWebSearchPreviewToolEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
filters: NotRequired[Nullable[OpenResponsesWebSearchPreviewToolFiltersTypedDict]]
class OpenResponsesWebSearchPreviewTool(BaseModel): class OpenResponsesWebSearchPreviewTool(BaseModel):
@@ -102,27 +44,10 @@ class OpenResponsesWebSearchPreviewTool(BaseModel):
user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET user_location: OptionalNullable[WebSearchPreviewToolUserLocation] = UNSET
engine: Annotated[
Optional[OpenResponsesWebSearchPreviewToolEngine],
PlainValidator(validate_open_enum(False)),
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
filters: OptionalNullable[OpenResponsesWebSearchPreviewToolFilters] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = ["search_context_size", "user_location"]
"search_context_size", nullable_fields = ["user_location"]
"user_location",
"engine",
"max_results",
"filters",
]
nullable_fields = ["user_location", "filters"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) serialized = handler(self)
@@ -12,12 +12,11 @@ from openrouter.types import (
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
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
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
@@ -26,18 +25,15 @@ OpenResponsesWebSearchToolType = Literal["web_search",]
class OpenResponsesWebSearchToolFiltersTypedDict(TypedDict): class OpenResponsesWebSearchToolFiltersTypedDict(TypedDict):
allowed_domains: NotRequired[Nullable[List[str]]] allowed_domains: NotRequired[Nullable[List[str]]]
excluded_domains: NotRequired[Nullable[List[str]]]
class OpenResponsesWebSearchToolFilters(BaseModel): class OpenResponsesWebSearchToolFilters(BaseModel):
allowed_domains: OptionalNullable[List[str]] = UNSET allowed_domains: OptionalNullable[List[str]] = UNSET
excluded_domains: OptionalNullable[List[str]] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = ["allowed_domains", "excluded_domains"] optional_fields = ["allowed_domains"]
nullable_fields = ["allowed_domains", "excluded_domains"] nullable_fields = ["allowed_domains"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) serialized = handler(self)
@@ -65,17 +61,6 @@ class OpenResponsesWebSearchToolFilters(BaseModel):
return m return m
OpenResponsesWebSearchToolEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
class OpenResponsesWebSearchToolTypedDict(TypedDict): class OpenResponsesWebSearchToolTypedDict(TypedDict):
r"""Web search tool configuration""" r"""Web search tool configuration"""
@@ -85,10 +70,6 @@ class OpenResponsesWebSearchToolTypedDict(TypedDict):
r"""Size of the search context for web search tools""" r"""Size of the search context for web search tools"""
user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]] user_location: NotRequired[Nullable[ResponsesWebSearchUserLocationTypedDict]]
r"""User location information for web search""" r"""User location information for web search"""
engine: NotRequired[OpenResponsesWebSearchToolEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
class OpenResponsesWebSearchTool(BaseModel): class OpenResponsesWebSearchTool(BaseModel):
@@ -106,24 +87,9 @@ class OpenResponsesWebSearchTool(BaseModel):
user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET user_location: OptionalNullable[ResponsesWebSearchUserLocation] = UNSET
r"""User location information for web search""" r"""User location information for web search"""
engine: Annotated[
Optional[OpenResponsesWebSearchToolEngine],
PlainValidator(validate_open_enum(False)),
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = ["filters", "search_context_size", "user_location"]
"filters",
"search_context_size",
"user_location",
"engine",
"max_results",
]
nullable_fields = ["filters", "user_location"] nullable_fields = ["filters", "user_location"]
null_default_fields = [] null_default_fields = []
@@ -21,16 +21,14 @@ from .responsesoutputmessage import (
ResponsesOutputMessage, ResponsesOutputMessage,
ResponsesOutputMessageTypedDict, ResponsesOutputMessageTypedDict,
) )
from .responsesservertooloutput import (
ResponsesServerToolOutput,
ResponsesServerToolOutputTypedDict,
)
from .responseswebsearchcalloutput import ( from .responseswebsearchcalloutput import (
ResponsesWebSearchCallOutput, ResponsesWebSearchCallOutput,
ResponsesWebSearchCallOutputTypedDict, ResponsesWebSearchCallOutputTypedDict,
) )
from openrouter.utils import get_discriminator
from pydantic import Discriminator, Tag
from typing import Union from typing import Union
from typing_extensions import TypeAliasType from typing_extensions import Annotated, TypeAliasType
ResponsesOutputItemTypedDict = TypeAliasType( ResponsesOutputItemTypedDict = TypeAliasType(
@@ -39,7 +37,6 @@ ResponsesOutputItemTypedDict = TypeAliasType(
ResponsesWebSearchCallOutputTypedDict, ResponsesWebSearchCallOutputTypedDict,
ResponsesOutputItemFileSearchCallTypedDict, ResponsesOutputItemFileSearchCallTypedDict,
ResponsesImageGenerationCallTypedDict, ResponsesImageGenerationCallTypedDict,
ResponsesServerToolOutputTypedDict,
ResponsesOutputMessageTypedDict, ResponsesOutputMessageTypedDict,
ResponsesOutputItemFunctionCallTypedDict, ResponsesOutputItemFunctionCallTypedDict,
ResponsesOutputItemReasoningTypedDict, ResponsesOutputItemReasoningTypedDict,
@@ -48,16 +45,15 @@ ResponsesOutputItemTypedDict = TypeAliasType(
r"""An output item from the response""" r"""An output item from the response"""
ResponsesOutputItem = TypeAliasType( ResponsesOutputItem = Annotated[
"ResponsesOutputItem",
Union[ Union[
ResponsesWebSearchCallOutput, Annotated[ResponsesOutputMessage, Tag("message")],
ResponsesOutputItemFileSearchCall, Annotated[ResponsesOutputItemReasoning, Tag("reasoning")],
ResponsesImageGenerationCall, Annotated[ResponsesOutputItemFunctionCall, Tag("function_call")],
ResponsesServerToolOutput, Annotated[ResponsesWebSearchCallOutput, Tag("web_search_call")],
ResponsesOutputMessage, Annotated[ResponsesOutputItemFileSearchCall, Tag("file_search_call")],
ResponsesOutputItemFunctionCall, Annotated[ResponsesImageGenerationCall, Tag("image_generation_call")],
ResponsesOutputItemReasoning,
], ],
) Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""An output item from the response""" r"""An output item from the response"""
@@ -1,55 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, Nullable, UnrecognizedStr
from openrouter.utils import validate_open_enum
import pydantic
from pydantic import ConfigDict
from pydantic.functional_validators import PlainValidator
from typing import Any, Dict, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
ResponsesServerToolOutputStatus = Union[
Literal[
"completed",
"in_progress",
"incomplete",
],
UnrecognizedStr,
]
class ResponsesServerToolOutputTypedDict(TypedDict):
r"""A generic OpenRouter server tool output item"""
type: str
r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)"""
status: ResponsesServerToolOutputStatus
id: NotRequired[str]
class ResponsesServerToolOutput(BaseModel):
r"""A generic OpenRouter server tool output item"""
model_config = ConfigDict(
populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
)
__pydantic_extra__: Dict[str, Nullable[Any]] = pydantic.Field(init=False)
type: str
r"""Server tool type (e.g. openrouter:datetime, openrouter:web_search)"""
status: Annotated[
ResponsesServerToolOutputStatus, PlainValidator(validate_open_enum(False))
]
id: Optional[str] = None
@property
def additional_properties(self):
return self.__pydantic_extra__
@additional_properties.setter
def additional_properties(self, value):
self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -1,39 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from typing import Literal, Optional
from typing_extensions import NotRequired, TypedDict
ResponsesWebSearchServerToolType = Literal["openrouter:web_search",]
class ResponsesWebSearchServerToolParametersTypedDict(TypedDict):
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5."""
max_total_results: NotRequired[float]
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""
class ResponsesWebSearchServerToolParameters(BaseModel):
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5."""
max_total_results: Optional[float] = None
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results."""
class ResponsesWebSearchServerToolTypedDict(TypedDict):
r"""OpenRouter built-in server tool: searches the web for current information"""
type: ResponsesWebSearchServerToolType
parameters: NotRequired[ResponsesWebSearchServerToolParametersTypedDict]
class ResponsesWebSearchServerTool(BaseModel):
r"""OpenRouter built-in server tool: searches the web for current information"""
type: ResponsesWebSearchServerToolType
parameters: Optional[ResponsesWebSearchServerToolParameters] = None
+13 -40
View File
@@ -5,9 +5,6 @@ from .chatmessagecontentitemcachecontrol import (
ChatMessageContentItemCacheControl, ChatMessageContentItemCacheControl,
ChatMessageContentItemCacheControlTypedDict, ChatMessageContentItemCacheControlTypedDict,
) )
from .datetimeservertool import DatetimeServerTool, DatetimeServerToolTypedDict
from .websearchservertool import WebSearchServerTool, WebSearchServerToolTypedDict
from .websearchshorthand import WebSearchShorthand, WebSearchShorthandTypedDict
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
Nullable, Nullable,
@@ -15,16 +12,15 @@ from openrouter.types import (
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
) )
from openrouter.utils import get_discriminator from pydantic import model_serializer
from pydantic import Discriminator, Tag, model_serializer from typing import Any, Dict, Literal, Optional
from typing import Any, Dict, Literal, Optional, Union from typing_extensions import NotRequired, TypedDict
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
ToolDefinitionJSONType = Literal["function",] ToolDefinitionJSONType = Literal["function",]
class ToolDefinitionJSONFunctionFunctionTypedDict(TypedDict): class ToolDefinitionJSONFunctionTypedDict(TypedDict):
r"""Function definition for tool calling""" r"""Function definition for tool calling"""
name: str name: str
@@ -37,7 +33,7 @@ class ToolDefinitionJSONFunctionFunctionTypedDict(TypedDict):
r"""Enable strict schema adherence""" r"""Enable strict schema adherence"""
class ToolDefinitionJSONFunctionFunction(BaseModel): class ToolDefinitionJSONFunction(BaseModel):
r"""Function definition for tool calling""" r"""Function definition for tool calling"""
name: str name: str
@@ -83,46 +79,23 @@ class ToolDefinitionJSONFunctionFunction(BaseModel):
return m return m
class ToolDefinitionJSONFunctionTypedDict(TypedDict): class ToolDefinitionJSONTypedDict(TypedDict):
r"""Tool definition for function calling"""
type: ToolDefinitionJSONType type: ToolDefinitionJSONType
function: ToolDefinitionJSONFunctionFunctionTypedDict function: ToolDefinitionJSONFunctionTypedDict
r"""Function definition for tool calling""" r"""Function definition for tool calling"""
cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict] cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict]
r"""Cache control for the content part""" r"""Cache control for the content part"""
class ToolDefinitionJSONFunction(BaseModel): class ToolDefinitionJSON(BaseModel):
r"""Tool definition for function calling"""
type: ToolDefinitionJSONType type: ToolDefinitionJSONType
function: ToolDefinitionJSONFunctionFunction function: ToolDefinitionJSONFunction
r"""Function definition for tool calling""" r"""Function definition for tool calling"""
cache_control: Optional[ChatMessageContentItemCacheControl] = None cache_control: Optional[ChatMessageContentItemCacheControl] = None
r"""Cache control for the content part""" r"""Cache control for the content part"""
ToolDefinitionJSONTypedDict = TypeAliasType(
"ToolDefinitionJSONTypedDict",
Union[
DatetimeServerToolTypedDict,
WebSearchServerToolTypedDict,
ToolDefinitionJSONFunctionTypedDict,
WebSearchShorthandTypedDict,
],
)
r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)"""
ToolDefinitionJSON = Annotated[
Union[
Annotated[ToolDefinitionJSONFunction, Tag("function")],
Annotated[DatetimeServerTool, Tag("openrouter:datetime")],
Annotated[WebSearchServerTool, Tag("openrouter:web_search")],
Annotated[WebSearchShorthand, Tag("web_search")],
Annotated[WebSearchShorthand, Tag("web_search_preview")],
Annotated[WebSearchShorthand, Tag("web_search_preview_2025_03_11")],
Annotated[WebSearchShorthand, Tag("web_search_2025_08_26")],
],
Discriminator(lambda m: get_discriminator(m, "type", "type")),
]
r"""Tool definition for function calling (regular function or OpenRouter built-in server tool)"""
@@ -1,120 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
WebSearchServerToolTypeOpenrouterWebSearch = Literal["openrouter:web_search",]
WebSearchServerToolEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
WebSearchServerToolSearchContextSize = Union[
Literal[
"low",
"medium",
"high",
],
UnrecognizedStr,
]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
WebSearchServerToolParametersType = Literal["approximate",]
class WebSearchServerToolUserLocationTypedDict(TypedDict):
r"""Approximate user location for location-biased results."""
type: NotRequired[WebSearchServerToolParametersType]
city: NotRequired[str]
region: NotRequired[str]
country: NotRequired[str]
timezone: NotRequired[str]
class WebSearchServerToolUserLocation(BaseModel):
r"""Approximate user location for location-biased results."""
type: Optional[WebSearchServerToolParametersType] = None
city: Optional[str] = None
region: Optional[str] = None
country: Optional[str] = None
timezone: Optional[str] = None
class WebSearchServerToolParametersTypedDict(TypedDict):
engine: NotRequired[WebSearchServerToolEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: NotRequired[float]
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: NotRequired[WebSearchServerToolSearchContextSize]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: NotRequired[WebSearchServerToolUserLocationTypedDict]
r"""Approximate user location for location-biased results."""
allowed_domains: NotRequired[List[str]]
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: NotRequired[List[str]]
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
class WebSearchServerToolParameters(BaseModel):
engine: Annotated[
Optional[WebSearchServerToolEngine], PlainValidator(validate_open_enum(False))
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: Optional[float] = None
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: Annotated[
Optional[WebSearchServerToolSearchContextSize],
PlainValidator(validate_open_enum(False)),
] = None
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: Optional[WebSearchServerToolUserLocation] = None
r"""Approximate user location for location-biased results."""
allowed_domains: Optional[List[str]] = None
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: Optional[List[str]] = None
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
class WebSearchServerToolTypedDict(TypedDict):
r"""OpenRouter built-in server tool: searches the web for current information"""
type: WebSearchServerToolTypeOpenrouterWebSearch
parameters: NotRequired[WebSearchServerToolParametersTypedDict]
class WebSearchServerTool(BaseModel):
r"""OpenRouter built-in server tool: searches the web for current information"""
type: WebSearchServerToolTypeOpenrouterWebSearch
parameters: Optional[WebSearchServerToolParameters] = None
@@ -1,218 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_open_enum
from pydantic.functional_validators import PlainValidator
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
WebSearchShorthandType = Union[
Literal[
"web_search",
"web_search_preview",
"web_search_preview_2025_03_11",
"web_search_2025_08_26",
],
UnrecognizedStr,
]
WebSearchShorthandEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
WebSearchShorthandSearchContextSize = Union[
Literal[
"low",
"medium",
"high",
],
UnrecognizedStr,
]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
WebSearchShorthandTypeApproximate = Literal["approximate",]
class WebSearchShorthandUserLocationTypedDict(TypedDict):
r"""Approximate user location for location-biased results."""
type: NotRequired[WebSearchShorthandTypeApproximate]
city: NotRequired[str]
region: NotRequired[str]
country: NotRequired[str]
timezone: NotRequired[str]
class WebSearchShorthandUserLocation(BaseModel):
r"""Approximate user location for location-biased results."""
type: Optional[WebSearchShorthandTypeApproximate] = None
city: Optional[str] = None
region: Optional[str] = None
country: Optional[str] = None
timezone: Optional[str] = None
WebSearchShorthandParametersEngine = Union[
Literal[
"auto",
"native",
"exa",
],
UnrecognizedStr,
]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
WebSearchShorthandParametersSearchContextSize = Union[
Literal[
"low",
"medium",
"high",
],
UnrecognizedStr,
]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
WebSearchShorthandParametersType = Literal["approximate",]
class WebSearchShorthandParametersUserLocationTypedDict(TypedDict):
r"""Approximate user location for location-biased results."""
type: NotRequired[WebSearchShorthandParametersType]
city: NotRequired[str]
region: NotRequired[str]
country: NotRequired[str]
timezone: NotRequired[str]
class WebSearchShorthandParametersUserLocation(BaseModel):
r"""Approximate user location for location-biased results."""
type: Optional[WebSearchShorthandParametersType] = None
city: Optional[str] = None
region: Optional[str] = None
country: Optional[str] = None
timezone: Optional[str] = None
class WebSearchShorthandParametersTypedDict(TypedDict):
engine: NotRequired[WebSearchShorthandParametersEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: NotRequired[float]
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: NotRequired[WebSearchShorthandParametersSearchContextSize]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: NotRequired[WebSearchShorthandParametersUserLocationTypedDict]
r"""Approximate user location for location-biased results."""
allowed_domains: NotRequired[List[str]]
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: NotRequired[List[str]]
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
class WebSearchShorthandParameters(BaseModel):
engine: Annotated[
Optional[WebSearchShorthandParametersEngine],
PlainValidator(validate_open_enum(False)),
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: Optional[float] = None
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: Annotated[
Optional[WebSearchShorthandParametersSearchContextSize],
PlainValidator(validate_open_enum(False)),
] = None
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: Optional[WebSearchShorthandParametersUserLocation] = None
r"""Approximate user location for location-biased results."""
allowed_domains: Optional[List[str]] = None
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: Optional[List[str]] = None
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
class WebSearchShorthandTypedDict(TypedDict):
r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search."""
type: WebSearchShorthandType
engine: NotRequired[WebSearchShorthandEngine]
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: NotRequired[float]
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: NotRequired[float]
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: NotRequired[WebSearchShorthandSearchContextSize]
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: NotRequired[WebSearchShorthandUserLocationTypedDict]
r"""Approximate user location for location-biased results."""
allowed_domains: NotRequired[List[str]]
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: NotRequired[List[str]]
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
parameters: NotRequired[WebSearchShorthandParametersTypedDict]
class WebSearchShorthand(BaseModel):
r"""Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search."""
type: Annotated[WebSearchShorthandType, PlainValidator(validate_open_enum(False))]
engine: Annotated[
Optional[WebSearchShorthandEngine], PlainValidator(validate_open_enum(False))
] = None
r"""Which search engine to use. \"auto\" (default) uses native if the provider supports it, otherwise Exa. \"native\" forces the provider's built-in search (parameters like max_results, search_context_size, and domain filters are not forwarded to the provider). \"exa\" forces the Exa search API."""
max_results: Optional[float] = None
r"""Maximum number of search results to return per search call. Defaults to 5. Only applies when using the Exa engine; ignored with native provider search."""
max_total_results: Optional[float] = None
r"""Maximum total number of search results across all search calls in a single request. Once this limit is reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic loops."""
search_context_size: Annotated[
Optional[WebSearchShorthandSearchContextSize],
PlainValidator(validate_open_enum(False)),
] = None
r"""How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa engine; ignored with native provider search."""
user_location: Optional[WebSearchShorthandUserLocation] = None
r"""Approximate user location for location-biased results."""
allowed_domains: Optional[List[str]] = None
r"""Limit search results to these domains. Only applies when using the Exa engine; ignored with native provider search."""
excluded_domains: Optional[List[str]] = None
r"""Exclude search results from these domains. Only applies when using the Exa engine; ignored with native provider search."""
parameters: Optional[WebSearchShorthandParameters] = None
-5
View File
@@ -15,7 +15,6 @@ if TYPE_CHECKING:
BadRequestResponseError, BadRequestResponseError,
BadRequestResponseErrorData, BadRequestResponseErrorData,
) )
from .conflictresponse_error import ConflictResponseError, ConflictResponseErrorData
from .edgenetworktimeoutresponse_error import ( from .edgenetworktimeoutresponse_error import (
EdgeNetworkTimeoutResponseError, EdgeNetworkTimeoutResponseError,
EdgeNetworkTimeoutResponseErrorData, EdgeNetworkTimeoutResponseErrorData,
@@ -70,8 +69,6 @@ __all__ = [
"BadGatewayResponseErrorData", "BadGatewayResponseErrorData",
"BadRequestResponseError", "BadRequestResponseError",
"BadRequestResponseErrorData", "BadRequestResponseErrorData",
"ConflictResponseError",
"ConflictResponseErrorData",
"EdgeNetworkTimeoutResponseError", "EdgeNetworkTimeoutResponseError",
"EdgeNetworkTimeoutResponseErrorData", "EdgeNetworkTimeoutResponseErrorData",
"ForbiddenResponseError", "ForbiddenResponseError",
@@ -107,8 +104,6 @@ _dynamic_imports: dict[str, str] = {
"BadGatewayResponseErrorData": ".badgatewayresponse_error", "BadGatewayResponseErrorData": ".badgatewayresponse_error",
"BadRequestResponseError": ".badrequestresponse_error", "BadRequestResponseError": ".badrequestresponse_error",
"BadRequestResponseErrorData": ".badrequestresponse_error", "BadRequestResponseErrorData": ".badrequestresponse_error",
"ConflictResponseError": ".conflictresponse_error",
"ConflictResponseErrorData": ".conflictresponse_error",
"EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error", "EdgeNetworkTimeoutResponseError": ".edgenetworktimeoutresponse_error",
"EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error", "EdgeNetworkTimeoutResponseErrorData": ".edgenetworktimeoutresponse_error",
"ForbiddenResponseError": ".forbiddenresponse_error", "ForbiddenResponseError": ".forbiddenresponse_error",
@@ -1,36 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from dataclasses import dataclass, field
import httpx
from openrouter.components import (
conflictresponseerrordata as components_conflictresponseerrordata,
)
from openrouter.errors import OpenRouterError
from openrouter.types import BaseModel, OptionalNullable, UNSET
from typing import Optional
class ConflictResponseErrorData(BaseModel):
error: components_conflictresponseerrordata.ConflictResponseErrorData
r"""Error data for ConflictResponse"""
user_id: OptionalNullable[str] = UNSET
@dataclass(unsafe_hash=True)
class ConflictResponseError(OpenRouterError):
r"""Conflict - Resource conflict or concurrent modification"""
data: ConflictResponseErrorData = field(hash=False)
def __init__(
self,
data: ConflictResponseErrorData,
raw_response: httpx.Response,
body: Optional[str] = None,
):
fallback = body or raw_response.text
message = str(data.error.message) or fallback
super().__init__(message, raw_response, body)
object.__setattr__(self, "data", data)
+12 -12
View File
@@ -18,7 +18,7 @@ class Models(BaseSDK):
http_referer: Optional[str] = None, http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None, x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None, x_open_router_categories: Optional[str] = None,
output_modalities: Optional[str] = None, output_modality: Optional[str] = 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,
@@ -33,7 +33,7 @@ class Models(BaseSDK):
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
: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
@@ -53,7 +53,7 @@ class Models(BaseSDK):
http_referer=http_referer, http_referer=http_referer,
x_open_router_title=x_open_router_title, x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories, x_open_router_categories=x_open_router_categories,
output_modalities=output_modalities, output_modality=output_modality,
) )
req = self._build_request( req = self._build_request(
@@ -133,7 +133,7 @@ class Models(BaseSDK):
http_referer: Optional[str] = None, http_referer: Optional[str] = None,
x_open_router_title: Optional[str] = None, x_open_router_title: Optional[str] = None,
x_open_router_categories: Optional[str] = None, x_open_router_categories: Optional[str] = None,
output_modalities: Optional[str] = None, output_modality: Optional[str] = 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,
@@ -148,7 +148,7 @@ class Models(BaseSDK):
:param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. :param x_open_router_categories: Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
: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
@@ -168,7 +168,7 @@ class Models(BaseSDK):
http_referer=http_referer, http_referer=http_referer,
x_open_router_title=x_open_router_title, x_open_router_title=x_open_router_title,
x_open_router_categories=x_open_router_categories, x_open_router_categories=x_open_router_categories,
output_modalities=output_modalities, output_modality=output_modality,
) )
req = self._build_request_async( req = self._build_request_async(
@@ -250,7 +250,7 @@ class Models(BaseSDK):
x_open_router_categories: Optional[str] = None, x_open_router_categories: Optional[str] = None,
category: Optional[operations.Category] = None, category: Optional[operations.Category] = None,
supported_parameters: Optional[str] = None, supported_parameters: Optional[str] = None,
output_modalities: Optional[str] = None, output_modality: Optional[str] = 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,
@@ -267,7 +267,7 @@ class Models(BaseSDK):
:param category: Filter models by use case category :param category: Filter models by use case category
:param supported_parameters: :param supported_parameters:
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
: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
@@ -289,7 +289,7 @@ class Models(BaseSDK):
x_open_router_categories=x_open_router_categories, x_open_router_categories=x_open_router_categories,
category=category, category=category,
supported_parameters=supported_parameters, supported_parameters=supported_parameters,
output_modalities=output_modalities, output_modality=output_modality,
) )
req = self._build_request( req = self._build_request(
@@ -371,7 +371,7 @@ class Models(BaseSDK):
x_open_router_categories: Optional[str] = None, x_open_router_categories: Optional[str] = None,
category: Optional[operations.Category] = None, category: Optional[operations.Category] = None,
supported_parameters: Optional[str] = None, supported_parameters: Optional[str] = None,
output_modalities: Optional[str] = None, output_modality: Optional[str] = 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,
@@ -388,7 +388,7 @@ class Models(BaseSDK):
:param category: Filter models by use case category :param category: Filter models by use case category
:param supported_parameters: :param supported_parameters:
:param output_modalities: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\". :param output_modality: Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".
: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
@@ -410,7 +410,7 @@ class Models(BaseSDK):
x_open_router_categories=x_open_router_categories, x_open_router_categories=x_open_router_categories,
category=category, category=category,
supported_parameters=supported_parameters, supported_parameters=supported_parameters,
output_modalities=output_modalities, output_modality=output_modality,
) )
req = self._build_request_async( req = self._build_request_async(
+2 -12
View File
@@ -411,7 +411,7 @@ class OAuth(BaseSDK):
), ),
), ),
request=req, request=req,
error_status_codes=["400", "401", "409", "4XX", "500", "5XX"], error_status_codes=["400", "401", "4XX", "500", "5XX"],
retry_config=retry_config, retry_config=retry_config,
) )
@@ -430,11 +430,6 @@ class OAuth(BaseSDK):
errors.UnauthorizedResponseErrorData, http_res errors.UnauthorizedResponseErrorData, http_res
) )
raise errors.UnauthorizedResponseError(response_data, http_res) raise errors.UnauthorizedResponseError(response_data, http_res)
if utils.match_response(http_res, "409", "application/json"):
response_data = unmarshal_json_response(
errors.ConflictResponseErrorData, http_res
)
raise errors.ConflictResponseError(response_data, http_res)
if utils.match_response(http_res, "500", "application/json"): if utils.match_response(http_res, "500", "application/json"):
response_data = unmarshal_json_response( response_data = unmarshal_json_response(
errors.InternalServerResponseErrorData, http_res errors.InternalServerResponseErrorData, http_res
@@ -569,7 +564,7 @@ class OAuth(BaseSDK):
), ),
), ),
request=req, request=req,
error_status_codes=["400", "401", "409", "4XX", "500", "5XX"], error_status_codes=["400", "401", "4XX", "500", "5XX"],
retry_config=retry_config, retry_config=retry_config,
) )
@@ -588,11 +583,6 @@ class OAuth(BaseSDK):
errors.UnauthorizedResponseErrorData, http_res errors.UnauthorizedResponseErrorData, http_res
) )
raise errors.UnauthorizedResponseError(response_data, http_res) raise errors.UnauthorizedResponseError(response_data, http_res)
if utils.match_response(http_res, "409", "application/json"):
response_data = unmarshal_json_response(
errors.ConflictResponseErrorData, http_res
)
raise errors.ConflictResponseError(response_data, http_res)
if utils.match_response(http_res, "500", "application/json"): if utils.match_response(http_res, "500", "application/json"):
response_data = unmarshal_json_response( response_data = unmarshal_json_response(
errors.InternalServerResponseErrorData, http_res errors.InternalServerResponseErrorData, http_res
+2 -2
View File
@@ -97,7 +97,7 @@ class GetModelsRequestTypedDict(TypedDict):
category: NotRequired[Category] category: NotRequired[Category]
r"""Filter models by use case category""" r"""Filter models by use case category"""
supported_parameters: NotRequired[str] supported_parameters: NotRequired[str]
output_modalities: NotRequired[str] output_modality: NotRequired[str]
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".""" r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
@@ -141,7 +141,7 @@ class GetModelsRequest(BaseModel):
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None ] = None
output_modalities: Annotated[ output_modality: Annotated[
Optional[str], Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None ] = None
+2 -2
View File
@@ -68,7 +68,7 @@ class ListModelsCountRequestTypedDict(TypedDict):
r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings. r"""Comma-separated list of app categories (e.g. \"cli-agent,cloud-agent\"). Used for marketplace rankings.
""" """
output_modalities: NotRequired[str] output_modality: NotRequired[str]
r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\".""" r"""Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio, embeddings) or \"all\" to include all models. Defaults to \"text\"."""
@@ -101,7 +101,7 @@ class ListModelsCountRequest(BaseModel):
""" """
output_modalities: Annotated[ output_modality: Annotated[
Optional[str], Optional[str],
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
] = None ] = None
Generated
+1 -1
View File
@@ -211,7 +211,7 @@ wheels = [
[[package]] [[package]]
name = "openrouter" name = "openrouter"
version = "0.9.0" version = "0.8.0"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "httpcore" }, { name = "httpcore" },