From a35486030a2938ad17395e569e3f0673a6181f5c Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Fri, 12 Dec 2025 15:04:53 -0500 Subject: [PATCH 1/4] Project import generated by Copybara. GitOrigin-RevId: 94074033e15542b78c82f8a4fe721be656aeaaed --- .claude/settings.local.json | 4 +--- .speakeasy/gen.lock | 6 +++--- .speakeasy/gen.yaml | 2 +- .speakeasy/in.openapi.yaml | 4 ---- .speakeasy/out.openapi.yaml | 4 ---- .speakeasy/workflow.lock | 14 +++++++------- .../chatgenerationparamspluginfileparser.md | 1 - .../openresponsesrequestpluginfileparser.md | 1 - examples/oauth_pkce_example.py | 6 ++++-- pyproject.toml | 2 +- src/openrouter/_version.py | 4 ++-- src/openrouter/components/chatgenerationparams.py | 3 --- src/openrouter/components/openresponsesrequest.py | 3 --- 13 files changed, 19 insertions(+), 35 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 6e8450d..b12585e 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,9 +1,7 @@ { "permissions": { "allow": [ - "Bash(python3:*)", - "Bash(git push:*)", - "Bash(gh pr create:*)" + "Bash(python3:*)" ], "deny": [], "ask": [] diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index bada82f..4cf78fe 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: e929ecf569d79ab96a315332a4855566 + docChecksum: 775966841832e95cb8d37401c576b4b6 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 - releaseVersion: 0.0.22 - configChecksum: 0afda3910a58a8d797ac6674fa858711 + releaseVersion: 0.0.16 + configChecksum: cd00e781b0ef78cfcb3fe812f51e93ff repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 93a6aea..5006069 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true python: - version: 0.0.22 + version: 0.0.16 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index a5f339a..90136bd 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -3795,8 +3795,6 @@ components: enabled: type: boolean description: Set to false to disable the file-parser plugin for this request. Defaults to true. - max_files: - type: number pdf: type: object properties: @@ -5328,8 +5326,6 @@ components: const: file-parser enabled: type: boolean - max_files: - type: number pdf: type: object properties: diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 5506188..fbd831a 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3805,8 +3805,6 @@ components: enabled: type: boolean description: Set to false to disable the file-parser plugin for this request. Defaults to true. - max_files: - type: number pdf: type: object properties: @@ -5340,8 +5338,6 @@ components: const: file-parser enabled: type: boolean - max_files: - type: number pdf: type: object properties: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 04703aa..d16a28f 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,14 +2,14 @@ speakeasyVersion: 1.666.0 sources: -OAS: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:f1b59b9b643de5e20d6e3299a8274783d8c0854615876f5d7f6f081814842695 - sourceBlobDigest: sha256:ee1f2422281b3ed5b38951c74636ad192c9bb160f216069c1f7931ccc4e52553 + sourceRevisionDigest: sha256:01256c8494de6bfc13c36d82ae316a6a13d402194f844618bcd4d59e34f325f3 + sourceBlobDigest: sha256:4c80e48fd5e1cd030e68d664eb93984b4d5946867252ff1755a2bd2a05eccd4e tags: - latest OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b128cdb6be96021e55feea5e2dcb6e7438de706138fcde4f871b14877885445b - sourceBlobDigest: sha256:8b15f72eaabbd77f4642be28a2861fd1cfd5d8cfe96e72fb8a76832387c64fab + sourceRevisionDigest: sha256:cfb565b0217763fa566062e31b6f01db05dfec6bdd0746b429f03b8600588989 + sourceBlobDigest: sha256:b985c3342982a1c6e2163e6bb1ebc6066117f1d4c3dfc6fa219768cf6f7fc8d1 tags: - latest - 1.0.0 @@ -17,10 +17,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:b128cdb6be96021e55feea5e2dcb6e7438de706138fcde4f871b14877885445b - sourceBlobDigest: sha256:8b15f72eaabbd77f4642be28a2861fd1cfd5d8cfe96e72fb8a76832387c64fab + sourceRevisionDigest: sha256:cfb565b0217763fa566062e31b6f01db05dfec6bdd0746b429f03b8600588989 + sourceBlobDigest: sha256:b985c3342982a1c6e2163e6bb1ebc6066117f1d4c3dfc6fa219768cf6f7fc8d1 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:92747cd4c744e6671784b73c124d89adc662799d11caf5e6573880f6bfb52405 + codeSamplesRevisionDigest: sha256:badb3333f4862c5024a05b0b8456c4491edca4c2e3511c10da240942fc5e5397 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/docs/components/chatgenerationparamspluginfileparser.md b/docs/components/chatgenerationparamspluginfileparser.md index 7937ab1..f438508 100644 --- a/docs/components/chatgenerationparamspluginfileparser.md +++ b/docs/components/chatgenerationparamspluginfileparser.md @@ -7,5 +7,4 @@ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `id` | *Literal["file-parser"]* | :heavy_check_mark: | N/A | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `max_files` | *Optional[float]* | :heavy_minus_sign: | N/A | | `pdf` | [Optional[components.ChatGenerationParamsPdf]](../components/chatgenerationparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/openresponsesrequestpluginfileparser.md b/docs/components/openresponsesrequestpluginfileparser.md index 9ad57a6..aee432a 100644 --- a/docs/components/openresponsesrequestpluginfileparser.md +++ b/docs/components/openresponsesrequestpluginfileparser.md @@ -7,5 +7,4 @@ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `id` | [components.IDFileParser](../components/idfileparser.md) | :heavy_check_mark: | N/A | | `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. | -| `max_files` | *Optional[float]* | :heavy_minus_sign: | N/A | | `pdf` | [Optional[components.OpenResponsesRequestPdf]](../components/openresponsesrequestpdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/examples/oauth_pkce_example.py b/examples/oauth_pkce_example.py index e07e3e3..b394a7d 100644 --- a/examples/oauth_pkce_example.py +++ b/examples/oauth_pkce_example.py @@ -7,10 +7,12 @@ """ from openrouter import OpenRouter -from openrouter.utils import ( +from openrouter.utils.oauth_create_sha256_code_challenge import ( oauth_create_sha256_code_challenge, - oauth_create_authorization_url, CreateSHA256CodeChallengeRequest, +) +from openrouter.utils.oauth_create_authorization_url import ( + oauth_create_authorization_url, CreateAuthorizationUrlRequestWithPKCE, ) diff --git a/pyproject.toml b/pyproject.toml index 9ec2c59..0bca6bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.0.22" +version = "0.0.16" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index 927c895..af0bab6 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.0.22" +__version__: str = "0.0.16" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.768.0" -__user_agent__: str = "speakeasy-sdk/python 0.0.22 2.768.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.0.16 2.768.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/chatgenerationparams.py b/src/openrouter/components/chatgenerationparams.py index 588668f..c0d4a56 100644 --- a/src/openrouter/components/chatgenerationparams.py +++ b/src/openrouter/components/chatgenerationparams.py @@ -276,7 +276,6 @@ class ChatGenerationParamsPdf(BaseModel): class ChatGenerationParamsPluginFileParserTypedDict(TypedDict): id: Literal["file-parser"] enabled: NotRequired[bool] - max_files: NotRequired[float] pdf: NotRequired[ChatGenerationParamsPdfTypedDict] @@ -290,8 +289,6 @@ class ChatGenerationParamsPluginFileParser(BaseModel): enabled: Optional[bool] = None - max_files: Optional[float] = None - pdf: Optional[ChatGenerationParamsPdf] = None diff --git a/src/openrouter/components/openresponsesrequest.py b/src/openrouter/components/openresponsesrequest.py index d12b9b8..6053832 100644 --- a/src/openrouter/components/openresponsesrequest.py +++ b/src/openrouter/components/openresponsesrequest.py @@ -406,7 +406,6 @@ class OpenResponsesRequestPluginFileParserTypedDict(TypedDict): id: IDFileParser enabled: NotRequired[bool] r"""Set to false to disable the file-parser plugin for this request. Defaults to true.""" - max_files: NotRequired[float] pdf: NotRequired[OpenResponsesRequestPdfTypedDict] @@ -416,8 +415,6 @@ class OpenResponsesRequestPluginFileParser(BaseModel): enabled: Optional[bool] = None r"""Set to false to disable the file-parser plugin for this request. Defaults to true.""" - max_files: Optional[float] = None - pdf: Optional[OpenResponsesRequestPdf] = None From 9073d38dc1bd69e2142a8c36bdcd0a2d82a09634 Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Fri, 9 Jan 2026 14:20:03 +0000 Subject: [PATCH 2/4] Project import generated by Copybara. GitOrigin-RevId: 849282a42d3b2948d0ca0f7fd1427c31af709bbd --- .claude/settings.local.json | 4 +- .speakeasy/gen.lock | 90 ++- .speakeasy/gen.yaml | 4 +- .speakeasy/in.openapi.yaml | 763 ++++++++++++------ .speakeasy/lint.yaml | 10 + .speakeasy/out.openapi.yaml | 728 ++++++++++++----- .speakeasy/workflow.lock | 11 +- docs/components/chatgenerationparams.md | 6 +- .../chatgenerationparamsimageconfig.md | 17 + .../chatgenerationparamspluginautorouter.md | 10 + .../chatgenerationparamspluginfileparser.md | 10 +- .../chatgenerationparamspluginunion.md | 6 + .../chatgenerationparamspluginweb.md | 14 +- ...chatgenerationparamspreferredmaxlatency.md | 11 + ...enerationparamspreferredmaxlatencyunion.md | 17 + ...tgenerationparamspreferredminthroughput.md | 11 + ...rationparamspreferredminthroughputunion.md | 17 + .../chatgenerationparamsprovider.md | 30 +- docs/components/chatresponsechoice.md | 1 + docs/components/chatstreamingmessagechunk.md | 3 +- docs/components/effort.md | 10 +- docs/components/engine.md | 9 + docs/components/idautorouter.md | 8 + docs/components/modality.md | 9 + .../openresponsesreasoningformat.md | 15 +- docs/components/openresponsesrequest.md | 3 +- docs/components/openresponsesrequestignore.md | 17 + .../openresponsesrequestimageconfig.md | 17 + docs/components/openresponsesrequestonly.md | 17 + docs/components/openresponsesrequestorder.md | 17 + .../openresponsesrequestpluginautorouter.md | 10 + .../openresponsesrequestpluginfileparser.md | 10 +- .../openresponsesrequestpluginunion.md | 6 + .../openresponsesrequestpluginweb.md | 14 +- .../openresponsesrequestprovider.md | 30 +- docs/components/openresponsesrequestsort.md | 25 + docs/components/parameter.md | 1 + docs/components/partition.md | 9 + docs/components/pdf.md | 8 + docs/components/pdfengine.md | 10 + docs/components/pdfparserengine.md | 12 + docs/components/pdfparseroptions.md | 10 + docs/components/percentilelatencycutoffs.md | 13 + docs/components/percentilestats.md | 13 + .../components/percentilethroughputcutoffs.md | 13 + docs/components/preferredmaxlatency.md | 25 + docs/components/preferredminthroughput.md | 25 + docs/components/prompttokensdetails.md | 11 +- docs/components/providername.md | 4 +- docs/components/providerpreferences.md | 22 + docs/components/providerpreferencesignore.md | 17 + .../components/providerpreferencesmaxprice.md | 14 + docs/components/providerpreferencesonly.md | 17 + docs/components/providerpreferencesorder.md | 17 + .../providerpreferencespartition.md | 9 + .../providerpreferencesprovidersort.md | 10 + .../providerpreferencesprovidersortconfig.md | 9 + .../providerpreferencessortunion.md | 25 + docs/components/providersort.md | 2 - docs/components/providersortconfig.md | 9 + docs/components/providersortconfigenum.md | 10 + docs/components/providersortconfigunion.md | 17 + docs/components/providersortunion.md | 17 + docs/components/publicendpoint.md | 4 +- .../responsesoutputitemreasoning.md | 18 +- .../responsesoutputitemreasoningformat.md | 15 + docs/components/responsesoutputmodality.md | 9 + docs/components/route.md | 9 + docs/components/schema0enum.md | 4 +- docs/components/schema3.md | 23 + docs/components/schema3reasoningencrypted.md | 12 + docs/components/schema3reasoningsummary.md | 12 + docs/components/schema3reasoningtext.md | 13 + docs/components/schema5.md | 13 + docs/components/sortenum.md | 10 + docs/components/websearchengine.md | 11 + docs/operations/createembeddingsrequest.md | 18 +- docs/operations/getparametersrequest.md | 10 +- docs/operations/listendpointsresponse.md | 6 +- docs/operations/supportedparameter.md | 1 + docs/sdks/chat/README.md | 4 +- docs/sdks/embeddings/README.md | 20 +- docs/sdks/parameters/README.md | 14 +- docs/sdks/responses/README.md | 3 +- examples/oauth_pkce_example.py | 6 +- pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/chat.py | 82 +- src/openrouter/components/__init__.py | 302 +++++-- src/openrouter/components/_schema0.py | 4 +- src/openrouter/components/_schema3.py | 229 ++++++ .../components/chatgenerationparams.py | 261 ++++-- .../components/chatgenerationtokenusage.py | 3 + .../components/chatresponsechoice.py | 7 +- .../components/chatstreamingmessagechunk.py | 13 +- .../components/openresponsesinput.py | 4 +- .../components/openresponsesreasoning.py | 1 + .../components/openresponsesrequest.py | 206 +++-- src/openrouter/components/parameter.py | 1 + src/openrouter/components/pdfparserengine.py | 16 + src/openrouter/components/pdfparseroptions.py | 25 + .../components/percentilelatencycutoffs.py | 71 ++ src/openrouter/components/percentilestats.py | 34 + .../components/percentilethroughputcutoffs.py | 71 ++ .../components/preferredmaxlatency.py | 21 + .../components/preferredminthroughput.py | 22 + src/openrouter/components/providername.py | 4 +- .../components/providerpreferences.py | 355 ++++++++ src/openrouter/components/providersort.py | 1 - .../components/providersortconfig.py | 71 ++ .../components/providersortunion.py | 23 + src/openrouter/components/publicendpoint.py | 11 + .../components/responsesoutputitem.py | 2 +- .../responsesoutputitemreasoning.py | 46 +- .../components/responsesoutputmodality.py | 14 + src/openrouter/components/websearchengine.py | 15 + src/openrouter/embeddings.py | 14 +- src/openrouter/operations/__init__.py | 33 - src/openrouter/operations/createembeddings.py | 265 +----- src/openrouter/operations/getparameters.py | 83 +- src/openrouter/parameters.py | 4 +- src/openrouter/responses.py | 72 +- uv.lock | 4 +- 123 files changed, 3734 insertions(+), 1226 deletions(-) create mode 100644 .speakeasy/lint.yaml create mode 100644 docs/components/chatgenerationparamsimageconfig.md create mode 100644 docs/components/chatgenerationparamspluginautorouter.md create mode 100644 docs/components/chatgenerationparamspreferredmaxlatency.md create mode 100644 docs/components/chatgenerationparamspreferredmaxlatencyunion.md create mode 100644 docs/components/chatgenerationparamspreferredminthroughput.md create mode 100644 docs/components/chatgenerationparamspreferredminthroughputunion.md create mode 100644 docs/components/engine.md create mode 100644 docs/components/idautorouter.md create mode 100644 docs/components/modality.md create mode 100644 docs/components/openresponsesrequestignore.md create mode 100644 docs/components/openresponsesrequestimageconfig.md create mode 100644 docs/components/openresponsesrequestonly.md create mode 100644 docs/components/openresponsesrequestorder.md create mode 100644 docs/components/openresponsesrequestpluginautorouter.md create mode 100644 docs/components/openresponsesrequestsort.md create mode 100644 docs/components/partition.md create mode 100644 docs/components/pdf.md create mode 100644 docs/components/pdfengine.md create mode 100644 docs/components/pdfparserengine.md create mode 100644 docs/components/pdfparseroptions.md create mode 100644 docs/components/percentilelatencycutoffs.md create mode 100644 docs/components/percentilestats.md create mode 100644 docs/components/percentilethroughputcutoffs.md create mode 100644 docs/components/preferredmaxlatency.md create mode 100644 docs/components/preferredminthroughput.md create mode 100644 docs/components/providerpreferences.md create mode 100644 docs/components/providerpreferencesignore.md create mode 100644 docs/components/providerpreferencesmaxprice.md create mode 100644 docs/components/providerpreferencesonly.md create mode 100644 docs/components/providerpreferencesorder.md create mode 100644 docs/components/providerpreferencespartition.md create mode 100644 docs/components/providerpreferencesprovidersort.md create mode 100644 docs/components/providerpreferencesprovidersortconfig.md create mode 100644 docs/components/providerpreferencessortunion.md create mode 100644 docs/components/providersortconfig.md create mode 100644 docs/components/providersortconfigenum.md create mode 100644 docs/components/providersortconfigunion.md create mode 100644 docs/components/providersortunion.md create mode 100644 docs/components/responsesoutputitemreasoningformat.md create mode 100644 docs/components/responsesoutputmodality.md create mode 100644 docs/components/route.md create mode 100644 docs/components/schema3.md create mode 100644 docs/components/schema3reasoningencrypted.md create mode 100644 docs/components/schema3reasoningsummary.md create mode 100644 docs/components/schema3reasoningtext.md create mode 100644 docs/components/schema5.md create mode 100644 docs/components/sortenum.md create mode 100644 docs/components/websearchengine.md create mode 100644 src/openrouter/components/_schema3.py create mode 100644 src/openrouter/components/pdfparserengine.py create mode 100644 src/openrouter/components/pdfparseroptions.py create mode 100644 src/openrouter/components/percentilelatencycutoffs.py create mode 100644 src/openrouter/components/percentilestats.py create mode 100644 src/openrouter/components/percentilethroughputcutoffs.py create mode 100644 src/openrouter/components/preferredmaxlatency.py create mode 100644 src/openrouter/components/preferredminthroughput.py create mode 100644 src/openrouter/components/providerpreferences.py create mode 100644 src/openrouter/components/providersortconfig.py create mode 100644 src/openrouter/components/providersortunion.py create mode 100644 src/openrouter/components/responsesoutputmodality.py create mode 100644 src/openrouter/components/websearchengine.py diff --git a/.claude/settings.local.json b/.claude/settings.local.json index b12585e..6e8450d 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -1,7 +1,9 @@ { "permissions": { "allow": [ - "Bash(python3:*)" + "Bash(python3:*)", + "Bash(git push:*)", + "Bash(gh pr create:*)" ], "deny": [], "ask": [] diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4cf78fe..d262fc2 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: 775966841832e95cb8d37401c576b4b6 + docChecksum: 772a7ec8092cfd6437e71806e7b19e28 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 - releaseVersion: 0.0.16 - configChecksum: cd00e781b0ef78cfcb3fe812f51e93ff + releaseVersion: 0.0.17 + configChecksum: 50ef18bf69272fc09c257e3562e1b0df repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true @@ -29,6 +29,7 @@ features: globalServerURLs: 3.2.0 globals: 3.0.0 groups: 3.0.1 + ignores: 3.0.1 methodArguments: 1.0.2 methodSecurity: 3.0.1 nameOverrides: 3.0.1 @@ -59,21 +60,23 @@ generatedFiles: - docs/components/chaterrorerror.md - docs/components/chatgenerationparams.md - docs/components/chatgenerationparamsdatacollection.md - - docs/components/chatgenerationparamsengine.md + - docs/components/chatgenerationparamsimageconfig.md - docs/components/chatgenerationparamsmaxprice.md - - docs/components/chatgenerationparamspdf.md - - docs/components/chatgenerationparamspdfengine.md + - docs/components/chatgenerationparamspluginautorouter.md - docs/components/chatgenerationparamspluginfileparser.md - docs/components/chatgenerationparamspluginmoderation.md - docs/components/chatgenerationparamspluginresponsehealing.md - docs/components/chatgenerationparamspluginunion.md - docs/components/chatgenerationparamspluginweb.md + - docs/components/chatgenerationparamspreferredmaxlatency.md + - docs/components/chatgenerationparamspreferredmaxlatencyunion.md + - docs/components/chatgenerationparamspreferredminthroughput.md + - docs/components/chatgenerationparamspreferredminthroughputunion.md - docs/components/chatgenerationparamsprovider.md - docs/components/chatgenerationparamsresponseformatjsonobject.md - docs/components/chatgenerationparamsresponseformatpython.md - docs/components/chatgenerationparamsresponseformattext.md - docs/components/chatgenerationparamsresponseformatunion.md - - docs/components/chatgenerationparamsroute.md - docs/components/chatgenerationparamsstop.md - docs/components/chatgenerationtokenusage.md - docs/components/chatmessagecontentitem.md @@ -123,16 +126,17 @@ generatedFiles: - docs/components/edgenetworktimeoutresponseerrordata.md - docs/components/effort.md - docs/components/endpointstatus.md + - docs/components/engine.md - docs/components/filecitation.md - docs/components/filecitationtype.md - docs/components/filepath.md - docs/components/filepathtype.md - docs/components/forbiddenresponseerrordata.md + - docs/components/idautorouter.md - docs/components/idfileparser.md - docs/components/idmoderation.md - docs/components/idresponsehealing.md - docs/components/idweb.md - - docs/components/ignore.md - docs/components/imagegenerationstatus.md - docs/components/imageurl.md - docs/components/inputmodality.md @@ -144,6 +148,7 @@ generatedFiles: - docs/components/message.md - docs/components/messagecontent.md - docs/components/messagedeveloper.md + - docs/components/modality.md - docs/components/model.md - docs/components/modelarchitecture.md - docs/components/modelarchitectureinstructtype.md @@ -155,7 +160,6 @@ generatedFiles: - docs/components/namedtoolchoicefunction.md - docs/components/notfoundresponseerrordata.md - docs/components/object.md - - docs/components/only.md - docs/components/openairesponsesannotation.md - docs/components/openairesponsesincludable.md - docs/components/openairesponsesincompletedetails.md @@ -254,17 +258,19 @@ generatedFiles: - docs/components/openresponsesreasoningsummarytextdoneeventtype.md - docs/components/openresponsesreasoningtype.md - docs/components/openresponsesrequest.md - - docs/components/openresponsesrequestengine.md + - docs/components/openresponsesrequestignore.md + - docs/components/openresponsesrequestimageconfig.md - docs/components/openresponsesrequestmaxprice.md - - docs/components/openresponsesrequestpdf.md - - docs/components/openresponsesrequestpdfengine.md + - docs/components/openresponsesrequestonly.md + - docs/components/openresponsesrequestorder.md + - docs/components/openresponsesrequestpluginautorouter.md - docs/components/openresponsesrequestpluginfileparser.md - docs/components/openresponsesrequestpluginmoderation.md - docs/components/openresponsesrequestpluginresponsehealing.md - docs/components/openresponsesrequestpluginunion.md - docs/components/openresponsesrequestpluginweb.md - docs/components/openresponsesrequestprovider.md - - docs/components/openresponsesrequestroute.md + - docs/components/openresponsesrequestsort.md - docs/components/openresponsesrequesttoolfunction.md - docs/components/openresponsesrequesttoolunion.md - docs/components/openresponsesrequesttype.md @@ -300,7 +306,6 @@ generatedFiles: - docs/components/openresponseswebsearchtool.md - docs/components/openresponseswebsearchtoolfilters.md - docs/components/openresponseswebsearchtooltype.md - - docs/components/order.md - docs/components/outputitemimagegenerationcall.md - docs/components/outputitemimagegenerationcalltype.md - docs/components/outputmessage.md @@ -316,15 +321,38 @@ generatedFiles: - docs/components/parameter.md - docs/components/part1.md - docs/components/part2.md + - docs/components/partition.md - docs/components/payloadtoolargeresponseerrordata.md - docs/components/paymentrequiredresponseerrordata.md + - docs/components/pdf.md + - docs/components/pdfengine.md + - docs/components/pdfparserengine.md + - docs/components/pdfparseroptions.md + - docs/components/percentilelatencycutoffs.md + - docs/components/percentilestats.md + - docs/components/percentilethroughputcutoffs.md - docs/components/perrequestlimits.md + - docs/components/preferredmaxlatency.md + - docs/components/preferredminthroughput.md - docs/components/pricing.md - docs/components/prompt.md - docs/components/prompttokensdetails.md - docs/components/providername.md - docs/components/provideroverloadedresponseerrordata.md + - docs/components/providerpreferences.md + - docs/components/providerpreferencesignore.md + - docs/components/providerpreferencesmaxprice.md + - docs/components/providerpreferencesonly.md + - docs/components/providerpreferencesorder.md + - docs/components/providerpreferencespartition.md + - docs/components/providerpreferencesprovidersort.md + - docs/components/providerpreferencesprovidersortconfig.md + - docs/components/providerpreferencessortunion.md - docs/components/providersort.md + - docs/components/providersortconfig.md + - docs/components/providersortconfigenum.md + - docs/components/providersortconfigunion.md + - docs/components/providersortunion.md - docs/components/publicendpoint.md - docs/components/publicendpointquantization.md - docs/components/publicpricing.md @@ -373,6 +401,7 @@ generatedFiles: - docs/components/responsesoutputitemfunctioncallstatusunion.md - docs/components/responsesoutputitemfunctioncalltype.md - docs/components/responsesoutputitemreasoning.md + - docs/components/responsesoutputitemreasoningformat.md - docs/components/responsesoutputitemreasoningstatuscompleted.md - docs/components/responsesoutputitemreasoningstatusincomplete.md - docs/components/responsesoutputitemreasoningstatusinprogress.md @@ -386,6 +415,7 @@ generatedFiles: - docs/components/responsesoutputmessagestatusinprogress.md - docs/components/responsesoutputmessagestatusunion.md - docs/components/responsesoutputmessagetype.md + - docs/components/responsesoutputmodality.md - docs/components/responsessearchcontextsize.md - docs/components/responseswebsearchcalloutput.md - docs/components/responseswebsearchcalloutputtype.md @@ -393,12 +423,18 @@ generatedFiles: - docs/components/responseswebsearchuserlocationtype.md - docs/components/responsetextconfig.md - docs/components/responsetextconfigverbosity.md + - docs/components/route.md - docs/components/schema0.md - docs/components/schema0enum.md + - docs/components/schema3.md + - docs/components/schema3reasoningencrypted.md + - docs/components/schema3reasoningsummary.md + - docs/components/schema3reasoningtext.md + - docs/components/schema5.md - docs/components/security.md - docs/components/servicetier.md - docs/components/serviceunavailableresponseerrordata.md - - docs/components/sort.md + - docs/components/sortenum.md - docs/components/streamoptions.md - docs/components/systemmessage.md - docs/components/systemmessagecontent.md @@ -440,6 +476,7 @@ generatedFiles: - docs/components/variables.md - docs/components/videourl1.md - docs/components/videourl2.md + - docs/components/websearchengine.md - docs/components/websearchpreviewtooluserlocation.md - docs/components/websearchpreviewtooluserlocationtype.md - docs/components/websearchstatus.md @@ -473,7 +510,6 @@ generatedFiles: - docs/operations/createcoinbasechargeresponse.md - docs/operations/createcoinbasechargesecurity.md - docs/operations/createembeddingsdata.md - - docs/operations/createembeddingsprovider.md - docs/operations/createembeddingsrequest.md - docs/operations/createembeddingsresponse.md - docs/operations/createembeddingsresponsebody.md @@ -502,13 +538,11 @@ generatedFiles: - docs/operations/getkeyresponse.md - docs/operations/getmodelsrequest.md - docs/operations/getparametersdata.md - - docs/operations/getparametersprovider.md - docs/operations/getparametersrequest.md - docs/operations/getparametersresponse.md - docs/operations/getparameterssecurity.md - docs/operations/getuseractivityrequest.md - docs/operations/getuseractivityresponse.md - - docs/operations/ignore.md - docs/operations/imageurl.md - docs/operations/input.md - docs/operations/inputunion.md @@ -521,12 +555,9 @@ generatedFiles: - docs/operations/listprovidersresponse.md - docs/operations/listrequest.md - docs/operations/listresponse.md - - docs/operations/maxprice.md - docs/operations/metadata.md - docs/operations/object.md - docs/operations/objectembedding.md - - docs/operations/only.md - - docs/operations/order.md - docs/operations/ratelimit.md - docs/operations/sendchatcompletionrequestresponse.md - docs/operations/supportedparameter.md @@ -570,6 +601,7 @@ generatedFiles: - src/openrouter/completions.py - src/openrouter/components/__init__.py - src/openrouter/components/_schema0.py + - src/openrouter/components/_schema3.py - src/openrouter/components/activityitem.py - src/openrouter/components/assistantmessage.py - src/openrouter/components/badgatewayresponseerrordata.py @@ -667,10 +699,20 @@ generatedFiles: - src/openrouter/components/parameter.py - src/openrouter/components/payloadtoolargeresponseerrordata.py - src/openrouter/components/paymentrequiredresponseerrordata.py + - src/openrouter/components/pdfparserengine.py + - src/openrouter/components/pdfparseroptions.py + - src/openrouter/components/percentilelatencycutoffs.py + - src/openrouter/components/percentilestats.py + - src/openrouter/components/percentilethroughputcutoffs.py - src/openrouter/components/perrequestlimits.py + - src/openrouter/components/preferredmaxlatency.py + - src/openrouter/components/preferredminthroughput.py - src/openrouter/components/providername.py - src/openrouter/components/provideroverloadedresponseerrordata.py + - src/openrouter/components/providerpreferences.py - src/openrouter/components/providersort.py + - src/openrouter/components/providersortconfig.py + - src/openrouter/components/providersortunion.py - src/openrouter/components/publicendpoint.py - src/openrouter/components/publicpricing.py - src/openrouter/components/quantization.py @@ -696,6 +738,7 @@ generatedFiles: - src/openrouter/components/responsesoutputitemfunctioncall.py - src/openrouter/components/responsesoutputitemreasoning.py - src/openrouter/components/responsesoutputmessage.py + - src/openrouter/components/responsesoutputmodality.py - src/openrouter/components/responsessearchcontextsize.py - src/openrouter/components/responseswebsearchcalloutput.py - src/openrouter/components/responseswebsearchuserlocation.py @@ -712,6 +755,7 @@ generatedFiles: - src/openrouter/components/unprocessableentityresponseerrordata.py - src/openrouter/components/urlcitation.py - src/openrouter/components/usermessage.py + - src/openrouter/components/websearchengine.py - src/openrouter/components/websearchpreviewtooluserlocation.py - src/openrouter/components/websearchstatus.py - src/openrouter/credits.py @@ -961,7 +1005,7 @@ examples: slug: "" responses: "200": - application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]}} + application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}}]}} "404": application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": @@ -970,7 +1014,7 @@ examples: speakeasy-default-list-endpoints-zdr: responses: "200": - application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true}]} + application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}, "throughput_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}}]} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} getParameters: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5006069..b708944 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true python: - version: 0.0.16 + version: 0.0.17 additionalDependencies: dev: {} main: {} @@ -39,6 +39,8 @@ python: - id - object - input + - models + - hash asyncMode: both authors: - OpenRouter diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 90136bd..88a1282 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -268,7 +268,24 @@ components: allOf: - $ref: '#/components/schemas/OutputItemReasoning' - type: object - properties: {} + properties: + signature: + type: string + nullable: true + description: A signature for the reasoning content, used for verification + example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: + type: string + nullable: true + enum: + - unknown + - openai-responses-v1 + - azure-openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + - google-gemini-v1 + description: The format of the reasoning content + example: anthropic-claude-v1 example: id: reasoning-123 type: reasoning @@ -279,6 +296,8 @@ components: content: - type: reasoning_text text: First, we analyze the problem... + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: anthropic-claude-v1 description: An output item containing reasoning OutputItemFunctionCall: type: object @@ -3224,6 +3243,7 @@ components: enum: - unknown - openai-responses-v1 + - azure-openai-responses-v1 - xai-responses-v1 - anthropic-claude-v1 - google-gemini-v1 @@ -3418,6 +3438,11 @@ components: example: summary: auto enabled: true + ResponsesOutputModality: + type: string + enum: + - text + - image OpenAIResponsesIncludable: type: string enum: @@ -3470,7 +3495,6 @@ components: - Fireworks - Friendli - GMICloud - - GoPomelo - Google - Google AI Studio - Groq @@ -3500,13 +3524,14 @@ components: - Phala - Relace - SambaNova + - Seed - SiliconFlow - Sourceful - Stealth - StreamLake - Switchpoint - - Targon - Together + - Upstage - Venice - WandB - Xiaomi @@ -3529,19 +3554,115 @@ components: example: fp16 ProviderSort: type: string - nullable: true enum: - price - throughput - latency - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is - performed. - example: price + ProviderSortConfig: + type: object + properties: + by: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - type: 'null' + partition: + anyOf: + - type: string + enum: + - model + - none + - type: 'null' BigNumberUnion: type: string description: A value in string format that is a large number example: 1000 + PercentileThroughputCutoffs: + type: object + properties: + p50: + type: number + nullable: true + description: Minimum p50 throughput (tokens/sec) + p75: + type: number + nullable: true + description: Minimum p75 throughput (tokens/sec) + p90: + type: number + nullable: true + description: Minimum p90 throughput (tokens/sec) + p99: + type: number + nullable: true + description: Minimum p99 throughput (tokens/sec) + description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 100 + p90: 50 + PreferredMinThroughput: + anyOf: + - type: number + - $ref: '#/components/schemas/PercentileThroughputCutoffs' + - nullable: true + description: >- + Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with + percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in + routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if + it meets the threshold. + example: 100 + PercentileLatencyCutoffs: + type: object + properties: + p50: + type: number + nullable: true + description: Maximum p50 latency (seconds) + p75: + type: number + nullable: true + description: Maximum p75 latency (seconds) + p90: + type: number + nullable: true + description: Maximum p90 latency (seconds) + p99: + type: number + nullable: true + description: Maximum p99 latency (seconds) + description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 5 + p90: 10 + PreferredMaxLatency: + anyOf: + - type: number + - $ref: '#/components/schemas/PercentileLatencyCutoffs' + - nullable: true + description: >- + Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific + cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using + fallback models, this may cause a fallback model to be used instead of the primary model if it meets the + threshold. + example: 5 + WebSearchEngine: + type: string + enum: + - native + - exa + description: The search engine to use for web search. + PDFParserEngine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + description: The engine to use for parsing PDF files. + PDFParserOptions: + type: object + properties: + engine: + $ref: '#/components/schemas/PDFParserEngine' + description: Options for PDF parsing. OpenResponsesRequest: type: object properties: @@ -3611,6 +3732,25 @@ components: minimum: 0 top_k: type: number + image_config: + type: object + additionalProperties: + anyOf: + - type: string + - type: number + description: >- + Provider-specific image configuration options. Keys and values vary by model/provider. See + https://openrouter.ai/docs/features/multimodal/image-generation for more details. + example: + aspect_ratio: '16:9' + modalities: + type: array + items: + $ref: '#/components/schemas/ResponsesOutputModality' + description: Output modalities for the response. Supported values are "text" and "image". + example: + - text + - image prompt_cache_key: type: string nullable: true @@ -3721,7 +3861,14 @@ components: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - $ref: '#/components/schemas/ProviderSort' + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing + is performed. + example: price max_price: type: object properties: @@ -3738,26 +3885,39 @@ components: description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - min_throughput: - type: number - nullable: true - example: 100 - description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving the - model with at least this throughput will be used. - max_latency: - type: number - nullable: true - example: 5 - description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with better - than this latency will be used. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: type: array items: oneOf: + - type: object + properties: + id: + type: string + enum: + - auto-router + enabled: + type: boolean + description: Set to false to disable the auto-router plugin for this request. Defaults to true. + allowed_models: + type: array + items: + type: string + description: >- + List of model patterns to filter which models the auto-router can route between. Supports + wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default + supported models list. + example: + - anthropic/* + - openai/gpt-4o + - google/* + required: + - id - type: object properties: id: @@ -3780,10 +3940,7 @@ components: search_prompt: type: string engine: - type: string - enum: - - native - - exa + $ref: '#/components/schemas/WebSearchEngine' required: - id - type: object @@ -3796,14 +3953,7 @@ components: type: boolean description: Set to false to disable the file-parser plugin for this request. Defaults to true. pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native + $ref: '#/components/schemas/PDFParserOptions' required: - id - type: object @@ -3824,9 +3974,13 @@ components: enum: - fallback - sort + deprecated: true description: >- - Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts - all endpoints together by routing criteria. + **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for + providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). + x-speakeasy-deprecation-message: Use providers.sort.partition instead. + x-speakeasy-ignore: true + x-fern-ignore: true user: type: string maxLength: 128 @@ -3986,6 +4140,109 @@ components: amount: 100 sender: '0x1234567890123456789012345678901234567890' chain_id: 1 + ProviderPreferences: + type: object + properties: + allow_fallbacks: + type: boolean + nullable: true + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the + next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + require_parameters: + type: boolean + nullable: true + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is + omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + data_collection: + $ref: '#/components/schemas/DataCollection' + zdr: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do + not retain prompts will be used. + example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the + author has allowed distillation will be used. + example: true + order: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this + list that supports your requested model, and fall back to the next if it is unavailable. If no providers are + available, the request will fail with an error message. + only: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider + settings for this request. + ignore: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider + settings for this request. + quantizations: + type: array + nullable: true + items: + $ref: '#/components/schemas/Quantization' + description: A list of quantization levels to filter the provider by. + sort: + allOf: + - $ref: '#/components/schemas/ProviderSort' + - anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing + is performed. + max_price: + type: object + properties: + prompt: + $ref: '#/components/schemas/BigNumberUnion' + completion: + $ref: '#/components/schemas/BigNumberUnion' + image: + $ref: '#/components/schemas/BigNumberUnion' + audio: + $ref: '#/components/schemas/BigNumberUnion' + request: + $ref: '#/components/schemas/BigNumberUnion' + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for + prompt and completion. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' + description: Provider routing preferences for the request. PublicPricing: type: object properties: @@ -4193,6 +4450,7 @@ components: - parallel_tool_calls - include_reasoning - reasoning + - reasoning_effort - web_search_options - verbosity example: temperature @@ -4416,6 +4674,32 @@ components: - -5 - -10 example: 0 + PercentileStats: + type: object + nullable: true + properties: + p50: + type: number + description: Median (50th percentile) + example: 25.5 + p75: + type: number + description: 75th percentile + example: 35.2 + p90: + type: number + description: 90th percentile + example: 48.7 + p99: + type: number + description: 99th percentile + example: 85.3 + required: + - p50 + - p75 + - p90 + - p99 + description: Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. PublicEndpoint: type: object properties: @@ -4483,6 +4767,14 @@ components: nullable: true supports_implicit_caching: type: boolean + latency_last_30m: + $ref: '#/components/schemas/PercentileStats' + throughput_last_30m: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: >- + Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token + generation speed. required: - name - model_name @@ -4496,6 +4788,8 @@ components: - supported_parameters - uptime_last_30m - supports_implicit_caching + - latency_last_30m + - throughput_last_30m description: Information about a specific model endpoint example: name: 'OpenAI: GPT-4' @@ -4518,6 +4812,16 @@ components: status: 0 uptime_last_30m: 99.5 supports_implicit_caching: true + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 ListEndpointsResponse: type: object properties: @@ -4621,6 +4925,16 @@ components: status: default uptime_last_30m: 99.5 supports_implicit_caching: true + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 __schema0: type: array items: @@ -4653,7 +4967,6 @@ components: - Fireworks - Friendli - GMICloud - - GoPomelo - Google - Google AI Studio - Groq @@ -4683,13 +4996,14 @@ components: - Phala - Relace - SambaNova + - Seed - SiliconFlow - Sourceful - Stealth - StreamLake - Switchpoint - - Targon - Together + - Upstage - Venice - WandB - Xiaomi @@ -4706,6 +5020,79 @@ components: anyOf: - $ref: '#/components/schemas/ChatCompletionFinishReason' - type: 'null' + __schema3: + oneOf: + - type: object + properties: + type: + type: string + const: reasoning.summary + summary: + type: string + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + - summary + - type: object + properties: + type: + type: string + const: reasoning.encrypted + data: + type: string + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + - data + - type: object + properties: + type: + type: string + const: reasoning.text + text: + anyOf: + - type: string + - type: 'null' + signature: + anyOf: + - type: string + - type: 'null' + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + type: object + __schema4: + anyOf: + - type: string + - type: 'null' + __schema5: + anyOf: + - type: string + enum: + - unknown + - openai-responses-v1 + - azure-openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + - google-gemini-v1 + - type: 'null' + __schema6: + type: number ModelName: type: string ChatMessageContentItemText: @@ -4923,6 +5310,8 @@ components: properties: cached_tokens: type: number + cache_write_tokens: + type: number audio_tokens: type: number video_tokens: @@ -5251,11 +5640,7 @@ components: The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. anyOf: - - type: string - enum: - - price - - throughput - - latency + - $ref: '#/components/schemas/ProviderSortUnion' - type: 'null' max_price: description: >- @@ -5273,19 +5658,61 @@ components: $ref: '#/components/schemas/__schema1' request: $ref: '#/components/schemas/__schema1' - min_throughput: + preferred_min_throughput: description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving the - model with at least this throughput will be used. + Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object + with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are + deprioritized in routing. When using fallback models, this may cause a fallback model to be used + instead of the primary model if it meets the threshold. anyOf: - - type: number + - anyOf: + - type: number + - type: object + properties: + p50: + anyOf: + - type: number + - type: 'null' + p75: + anyOf: + - type: number + - type: 'null' + p90: + anyOf: + - type: number + - type: 'null' + p99: + anyOf: + - type: number + - type: 'null' - type: 'null' - max_latency: + preferred_max_latency: description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with - better than this latency will be used. + Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with + percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are + deprioritized in routing. When using fallback models, this may cause a fallback model to be used + instead of the primary model if it meets the threshold. anyOf: - - type: number + - anyOf: + - type: number + - type: object + properties: + p50: + anyOf: + - type: number + - type: 'null' + p75: + anyOf: + - type: number + - type: 'null' + p90: + anyOf: + - type: number + - type: 'null' + p99: + anyOf: + - type: number + - type: 'null' - type: 'null' additionalProperties: false - type: 'null' @@ -5294,6 +5721,19 @@ components: type: array items: oneOf: + - type: object + properties: + id: + type: string + const: auto-router + enabled: + type: boolean + allowed_models: + type: array + items: + type: string + required: + - id - type: object properties: id: @@ -5348,9 +5788,6 @@ components: - id type: object route: - description: >- - Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts - all endpoints together by routing criteria. anyOf: - type: string enum: @@ -5430,12 +5867,12 @@ components: anyOf: - type: string enum: - - none - - minimal - - low - - medium - - high - xhigh + - high + - medium + - low + - minimal + - none - type: 'null' summary: anyOf: @@ -5514,8 +5951,27 @@ components: properties: echo_upstream_body: type: boolean + image_config: + type: object + propertyNames: + type: string + additionalProperties: + anyOf: + - type: string + - type: number + modalities: + type: array + items: + type: string + enum: + - text + - image required: - messages + ProviderSortUnion: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' ChatResponseChoice: type: object properties: @@ -5525,6 +5981,10 @@ components: type: number message: $ref: '#/components/schemas/AssistantMessage' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -5575,6 +6035,10 @@ components: type: array items: $ref: '#/components/schemas/ChatStreamingMessageToolCall' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema3' ChatStreamingChoice: type: object properties: @@ -6399,111 +6863,7 @@ paths: user: type: string provider: - type: object - properties: - allow_fallbacks: - type: boolean - nullable: true - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is - unavailable, use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's - unavailable. - require_parameters: - type: boolean - nullable: true - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this - setting is omitted or set to false, then providers will receive only the parameters they - support, and ignore the rest. - data_collection: - $ref: '#/components/schemas/DataCollection' - zdr: - type: boolean - nullable: true - description: >- - Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only - endpoints that do not retain prompts will be used. - example: true - enforce_distillable_text: - type: boolean - nullable: true - description: >- - Whether to restrict routing to only models that allow text distillation. When true, only models - where the author has allowed distillation will be used. - example: true - order: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the - subset of this list that supports your requested model, and fall back to the next if it is - unavailable. If no providers are available, the request will fail with an error message. - only: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed - provider settings for this request. - ignore: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide - ignored provider settings for this request. - quantizations: - type: array - nullable: true - items: - $ref: '#/components/schemas/Quantization' - description: A list of quantization levels to filter the provider by. - sort: - $ref: '#/components/schemas/ProviderSort' - max_price: - type: object - properties: - prompt: - $ref: '#/components/schemas/BigNumberUnion' - completion: - $ref: '#/components/schemas/BigNumberUnion' - image: - $ref: '#/components/schemas/BigNumberUnion' - audio: - $ref: '#/components/schemas/BigNumberUnion' - request: - $ref: '#/components/schemas/BigNumberUnion' - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million - tokens, for prompt and completion. - min_throughput: - type: number - nullable: true - example: 100 - description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving - the model with at least this throughput will be used. - max_latency: - type: number - nullable: true - example: 5 - description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with - better than this latency will be used. + $ref: '#/components/schemas/ProviderPreferences' input_type: type: string required: @@ -7105,77 +7465,7 @@ paths: name: slug in: path - schema: - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Amazon Nova - - Anthropic - - Arcee AI - - AtlasCloud - - Avian - - Azure - - BaseTen - - BytePlus - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - GoPomelo - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mara - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Sourceful - - Stealth - - StreamLake - - Switchpoint - - Targon - - Together - - Venice - - WandB - - Xiaomi - - xAI - - Z.AI - - FakeProvider + $ref: '#/components/schemas/ProviderName' required: false name: provider in: query @@ -7220,6 +7510,7 @@ paths: - parallel_tool_calls - include_reasoning - reasoning + - reasoning_effort - web_search_options - verbosity description: List of parameters supported by this model diff --git a/.speakeasy/lint.yaml b/.speakeasy/lint.yaml new file mode 100644 index 0000000..0b49ccc --- /dev/null +++ b/.speakeasy/lint.yaml @@ -0,0 +1,10 @@ +lintVersion: 1.0.0 +defaultRuleset: openrouter +rulesets: + openrouter: + rulesets: + - speakeasy-recommended + - speakeasy-generation + rules: + oas3-missing-example: + severity: "off" diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index fbd831a..c19e2c2 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -269,7 +269,25 @@ components: allOf: - $ref: '#/components/schemas/OutputItemReasoning' - type: object - properties: {} + properties: + signature: + type: string + nullable: true + description: A signature for the reasoning content, used for verification + example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: + type: string + nullable: true + enum: + - unknown + - openai-responses-v1 + - azure-openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + - google-gemini-v1 + description: The format of the reasoning content + example: anthropic-claude-v1 + x-speakeasy-unknown-values: allow example: id: reasoning-123 type: reasoning @@ -280,6 +298,8 @@ components: content: - type: reasoning_text text: First, we analyze the problem... + signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... + format: anthropic-claude-v1 description: An output item containing reasoning OutputItemFunctionCall: type: object @@ -3239,6 +3259,7 @@ components: enum: - unknown - openai-responses-v1 + - azure-openai-responses-v1 - xai-responses-v1 - anthropic-claude-v1 - google-gemini-v1 @@ -3434,6 +3455,12 @@ components: example: summary: auto enabled: true + ResponsesOutputModality: + type: string + enum: + - text + - image + x-speakeasy-unknown-values: allow OpenAIResponsesIncludable: type: string enum: @@ -3487,7 +3514,6 @@ components: - Fireworks - Friendli - GMICloud - - GoPomelo - Google - Google AI Studio - Groq @@ -3517,13 +3543,14 @@ components: - Phala - Relace - SambaNova + - Seed - SiliconFlow - Sourceful - Stealth - StreamLake - Switchpoint - - Targon - Together + - Upstage - Venice - WandB - Xiaomi @@ -3548,19 +3575,113 @@ components: x-speakeasy-unknown-values: allow ProviderSort: type: string - nullable: true enum: - price - throughput - latency - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - example: price x-speakeasy-unknown-values: allow + ProviderSortConfig: + type: object + properties: + by: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - type: 'null' + partition: + anyOf: + - type: string + enum: + - model + - none + x-speakeasy-unknown-values: allow + - type: 'null' BigNumberUnion: type: string description: A value in string format that is a large number example: 1000 + PercentileThroughputCutoffs: + type: object + properties: + p50: + type: number + nullable: true + description: Minimum p50 throughput (tokens/sec) + p75: + type: number + nullable: true + description: Minimum p75 throughput (tokens/sec) + p90: + type: number + nullable: true + description: Minimum p90 throughput (tokens/sec) + p99: + type: number + nullable: true + description: Minimum p99 throughput (tokens/sec) + description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 100 + p90: 50 + PreferredMinThroughput: + anyOf: + - type: number + - $ref: '#/components/schemas/PercentileThroughputCutoffs' + - nullable: true + description: >- + Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + example: 100 + PercentileLatencyCutoffs: + type: object + properties: + p50: + type: number + nullable: true + description: Maximum p50 latency (seconds) + p75: + type: number + nullable: true + description: Maximum p75 latency (seconds) + p90: + type: number + nullable: true + description: Maximum p90 latency (seconds) + p99: + type: number + nullable: true + description: Maximum p99 latency (seconds) + description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + example: + p50: 5 + p90: 10 + PreferredMaxLatency: + anyOf: + - type: number + - $ref: '#/components/schemas/PercentileLatencyCutoffs' + - nullable: true + description: >- + Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + example: 5 + WebSearchEngine: + type: string + enum: + - native + - exa + description: The search engine to use for web search. + x-speakeasy-unknown-values: allow + PDFParserEngine: + type: string + enum: + - mistral-ocr + - pdf-text + - native + description: The engine to use for parsing PDF files. + x-speakeasy-unknown-values: allow + PDFParserOptions: + type: object + properties: + engine: + $ref: '#/components/schemas/PDFParserEngine' + description: Options for PDF parsing. OpenResponsesRequest: type: object properties: @@ -3631,6 +3752,24 @@ components: minimum: 0 top_k: type: number + image_config: + type: object + additionalProperties: + anyOf: + - type: string + - type: number + description: >- + Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + example: + aspect_ratio: '16:9' + modalities: + type: array + items: + $ref: '#/components/schemas/ResponsesOutputModality' + description: Output modalities for the response. Supported values are "text" and "image". + example: + - text + - image prompt_cache_key: type: string nullable: true @@ -3733,7 +3872,13 @@ components: $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - $ref: '#/components/schemas/ProviderSort' + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + example: price max_price: type: object properties: @@ -3749,24 +3894,37 @@ components: $ref: '#/components/schemas/BigNumberUnion' description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - min_throughput: - type: number - nullable: true - example: 100 - description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. - max_latency: - type: number - nullable: true - example: 5 - description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: type: array items: oneOf: + - type: object + properties: + id: + type: string + enum: + - auto-router + enabled: + type: boolean + description: Set to false to disable the auto-router plugin for this request. Defaults to true. + allowed_models: + type: array + items: + type: string + description: >- + List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. + example: + - anthropic/* + - openai/gpt-4o + - google/* + required: + - id - type: object properties: id: @@ -3789,11 +3947,7 @@ components: search_prompt: type: string engine: - type: string - enum: - - native - - exa - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/WebSearchEngine' required: - id - type: object @@ -3806,15 +3960,7 @@ components: type: boolean description: Set to false to disable the file-parser plugin for this request. Defaults to true. pdf: - type: object - properties: - engine: - type: string - enum: - - mistral-ocr - - pdf-text - - native - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/PDFParserOptions' required: - id - type: object @@ -3835,8 +3981,12 @@ components: enum: - fallback - sort + deprecated: true description: >- - Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. + **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). + x-speakeasy-deprecation-message: Use providers.sort.partition instead. + x-speakeasy-ignore: true + x-fern-ignore: true x-speakeasy-unknown-values: allow user: type: string @@ -3994,6 +4144,100 @@ components: amount: 100 sender: '0x1234567890123456789012345678901234567890' chain_id: 1 + ProviderPreferences: + type: object + properties: + allow_fallbacks: + type: boolean + nullable: true + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + require_parameters: + type: boolean + nullable: true + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + data_collection: + $ref: '#/components/schemas/DataCollection' + zdr: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. + example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + example: true + order: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + only: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + ignore: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + quantizations: + type: array + nullable: true + items: + $ref: '#/components/schemas/Quantization' + description: A list of quantization levels to filter the provider by. + sort: + allOf: + - $ref: '#/components/schemas/ProviderSort' + - anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + max_price: + type: object + properties: + prompt: + $ref: '#/components/schemas/BigNumberUnion' + completion: + $ref: '#/components/schemas/BigNumberUnion' + image: + $ref: '#/components/schemas/BigNumberUnion' + audio: + $ref: '#/components/schemas/BigNumberUnion' + request: + $ref: '#/components/schemas/BigNumberUnion' + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' + description: Provider routing preferences for the request. PublicPricing: type: object properties: @@ -4205,6 +4449,7 @@ components: - parallel_tool_calls - include_reasoning - reasoning + - reasoning_effort - web_search_options - verbosity example: temperature @@ -4431,6 +4676,32 @@ components: - -10 example: 0 x-speakeasy-unknown-values: allow + PercentileStats: + type: object + nullable: true + properties: + p50: + type: number + description: Median (50th percentile) + example: 25.5 + p75: + type: number + description: 75th percentile + example: 35.2 + p90: + type: number + description: 90th percentile + example: 48.7 + p99: + type: number + description: 99th percentile + example: 85.3 + required: + - p50 + - p75 + - p90 + - p99 + description: Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. PublicEndpoint: type: object properties: @@ -4498,6 +4769,13 @@ components: nullable: true supports_implicit_caching: type: boolean + latency_last_30m: + $ref: '#/components/schemas/PercentileStats' + throughput_last_30m: + allOf: + - $ref: '#/components/schemas/PercentileStats' + - description: >- + Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. required: - name - model_name @@ -4511,6 +4789,8 @@ components: - supported_parameters - uptime_last_30m - supports_implicit_caching + - latency_last_30m + - throughput_last_30m description: Information about a specific model endpoint example: name: 'OpenAI: GPT-4' @@ -4533,6 +4813,16 @@ components: status: 0 uptime_last_30m: 99.5 supports_implicit_caching: true + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 ListEndpointsResponse: type: object properties: @@ -4636,6 +4926,16 @@ components: status: default uptime_last_30m: 99.5 supports_implicit_caching: true + latency_last_30m: + p50: 0.25 + p75: 0.35 + p90: 0.48 + p99: 0.85 + throughput_last_30m: + p50: 45.2 + p75: 38.5 + p90: 28.3 + p99: 15.1 __schema0: type: array items: @@ -4668,7 +4968,6 @@ components: - Fireworks - Friendli - GMICloud - - GoPomelo - Google - Google AI Studio - Groq @@ -4698,13 +4997,14 @@ components: - Phala - Relace - SambaNova + - Seed - SiliconFlow - Sourceful - Stealth - StreamLake - Switchpoint - - Targon - Together + - Upstage - Venice - WandB - Xiaomi @@ -4722,6 +5022,80 @@ components: anyOf: - $ref: '#/components/schemas/ChatCompletionFinishReason' - type: 'null' + __schema3: + oneOf: + - type: object + properties: + type: + type: string + const: reasoning.summary + summary: + type: string + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + - summary + - type: object + properties: + type: + type: string + const: reasoning.encrypted + data: + type: string + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + - data + - type: object + properties: + type: + type: string + const: reasoning.text + text: + anyOf: + - type: string + - type: 'null' + signature: + anyOf: + - type: string + - type: 'null' + id: + $ref: '#/components/schemas/__schema4' + format: + $ref: '#/components/schemas/__schema5' + index: + $ref: '#/components/schemas/__schema6' + required: + - type + type: object + __schema4: + anyOf: + - type: string + - type: 'null' + __schema5: + anyOf: + - type: string + enum: + - unknown + - openai-responses-v1 + - azure-openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + - google-gemini-v1 + x-speakeasy-unknown-values: allow + - type: 'null' + __schema6: + type: number ModelName: type: string ChatMessageContentItemText: @@ -4940,6 +5314,8 @@ components: properties: cached_tokens: type: number + cache_write_tokens: + type: number audio_tokens: type: number video_tokens: @@ -5264,12 +5640,7 @@ components: description: >- The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. anyOf: - - type: string - enum: - - price - - throughput - - latency - x-speakeasy-unknown-values: allow + - $ref: '#/components/schemas/ProviderSortUnion' - type: 'null' max_price: description: >- @@ -5286,17 +5657,55 @@ components: $ref: '#/components/schemas/__schema1' request: $ref: '#/components/schemas/__schema1' - min_throughput: + preferred_min_throughput: description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. + Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. anyOf: - - type: number + - anyOf: + - type: number + - type: object + properties: + p50: + anyOf: + - type: number + - type: 'null' + p75: + anyOf: + - type: number + - type: 'null' + p90: + anyOf: + - type: number + - type: 'null' + p99: + anyOf: + - type: number + - type: 'null' - type: 'null' - max_latency: + preferred_max_latency: description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. anyOf: - - type: number + - anyOf: + - type: number + - type: object + properties: + p50: + anyOf: + - type: number + - type: 'null' + p75: + anyOf: + - type: number + - type: 'null' + p90: + anyOf: + - type: number + - type: 'null' + p99: + anyOf: + - type: number + - type: 'null' - type: 'null' additionalProperties: false - type: 'null' @@ -5305,6 +5714,19 @@ components: type: array items: oneOf: + - type: object + properties: + id: + type: string + const: auto-router + enabled: + type: boolean + allowed_models: + type: array + items: + type: string + required: + - id - type: object properties: id: @@ -5361,8 +5783,6 @@ components: - id type: object route: - description: >- - Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. anyOf: - type: string enum: @@ -5441,12 +5861,12 @@ components: anyOf: - type: string enum: - - none - - minimal - - low - - medium - - high - xhigh + - high + - medium + - low + - minimal + - none x-speakeasy-unknown-values: allow - type: 'null' summary: @@ -5526,8 +5946,28 @@ components: properties: echo_upstream_body: type: boolean + image_config: + type: object + propertyNames: + type: string + additionalProperties: + anyOf: + - type: string + - type: number + modalities: + type: array + items: + type: string + enum: + - text + - image + x-speakeasy-unknown-values: allow required: - messages + ProviderSortUnion: + anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' ChatResponseChoice: type: object properties: @@ -5537,6 +5977,10 @@ components: type: number message: $ref: '#/components/schemas/AssistantMessage' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -5587,6 +6031,10 @@ components: type: array items: $ref: '#/components/schemas/ChatStreamingMessageToolCall' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema3' ChatStreamingChoice: type: object properties: @@ -6413,99 +6861,7 @@ paths: user: type: string provider: - type: object - properties: - allow_fallbacks: - type: boolean - nullable: true - description: > - Whether to allow backup providers to serve requests - - - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - require_parameters: - type: boolean - nullable: true - description: >- - Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. - data_collection: - $ref: '#/components/schemas/DataCollection' - zdr: - type: boolean - nullable: true - description: >- - Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. - example: true - enforce_distillable_text: - type: boolean - nullable: true - description: >- - Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. - example: true - order: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. - only: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. - ignore: - type: array - nullable: true - items: - anyOf: - - $ref: '#/components/schemas/ProviderName' - - type: string - description: >- - List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. - quantizations: - type: array - nullable: true - items: - $ref: '#/components/schemas/Quantization' - description: A list of quantization levels to filter the provider by. - sort: - $ref: '#/components/schemas/ProviderSort' - max_price: - type: object - properties: - prompt: - $ref: '#/components/schemas/BigNumberUnion' - completion: - $ref: '#/components/schemas/BigNumberUnion' - image: - $ref: '#/components/schemas/BigNumberUnion' - audio: - $ref: '#/components/schemas/BigNumberUnion' - request: - $ref: '#/components/schemas/BigNumberUnion' - description: >- - The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. - min_throughput: - type: number - nullable: true - example: 100 - description: >- - The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. - max_latency: - type: number - nullable: true - example: 5 - description: >- - The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. + $ref: '#/components/schemas/ProviderPreferences' input_type: type: string required: @@ -7095,78 +7451,7 @@ paths: name: slug in: path - schema: - type: string - enum: - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Amazon Nova - - Anthropic - - Arcee AI - - AtlasCloud - - Avian - - Azure - - BaseTen - - BytePlus - - Black Forest Labs - - Cerebras - - Chutes - - Cirrascale - - Clarifai - - Cloudflare - - Cohere - - Crusoe - - DeepInfra - - DeepSeek - - Featherless - - Fireworks - - Friendli - - GMICloud - - GoPomelo - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - Liquid - - Mara - - Mancer 2 - - Minimax - - ModelRun - - Mistral - - Modular - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Novita - - Nvidia - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - Relace - - SambaNova - - SiliconFlow - - Sourceful - - Stealth - - StreamLake - - Switchpoint - - Targon - - Together - - Venice - - WandB - - Xiaomi - - xAI - - Z.AI - - FakeProvider - x-speakeasy-unknown-values: allow + $ref: '#/components/schemas/ProviderName' required: false name: provider in: query @@ -7211,6 +7496,7 @@ paths: - parallel_tool_calls - include_reasoning - reasoning + - reasoning_effort - web_search_options - verbosity x-speakeasy-unknown-values: allow diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d16a28f..5cfa06b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -8,19 +8,20 @@ sources: - latest OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:cfb565b0217763fa566062e31b6f01db05dfec6bdd0746b429f03b8600588989 - sourceBlobDigest: sha256:b985c3342982a1c6e2163e6bb1ebc6066117f1d4c3dfc6fa219768cf6f7fc8d1 + sourceRevisionDigest: sha256:fcc289022d99776aaf9434e14ccc3c9878a847384b300158c84391c9f4aed6ce + sourceBlobDigest: sha256:40c2ad7a48417d63a674f078aa75768dc7266885f38003ab3e5c00067d444fbe tags: - latest + - subtree-sync-import-python-sdk - 1.0.0 targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:cfb565b0217763fa566062e31b6f01db05dfec6bdd0746b429f03b8600588989 - sourceBlobDigest: sha256:b985c3342982a1c6e2163e6bb1ebc6066117f1d4c3dfc6fa219768cf6f7fc8d1 + sourceRevisionDigest: sha256:fcc289022d99776aaf9434e14ccc3c9878a847384b300158c84391c9f4aed6ce + sourceBlobDigest: sha256:40c2ad7a48417d63a674f078aa75768dc7266885f38003ab3e5c00067d444fbe codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:badb3333f4862c5024a05b0b8456c4491edca4c2e3511c10da240942fc5e5397 + codeSamplesRevisionDigest: sha256:567674342c32a59ace54f464472abd2784897dbbe9e4bb6f953480ea84e03cf9 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/docs/components/chatgenerationparams.md b/docs/components/chatgenerationparams.md index 15d98c3..f01af13 100644 --- a/docs/components/chatgenerationparams.md +++ b/docs/components/chatgenerationparams.md @@ -7,7 +7,7 @@ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | `plugins` | List[[components.ChatGenerationParamsPluginUnion](../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | -| `route` | [OptionalNullable[components.ChatGenerationParamsRoute]](../components/chatgenerationparamsroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | +| `route` | [OptionalNullable[components.Route]](../components/route.md) | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | `messages` | List[[components.Message](../components/message.md)] | :heavy_check_mark: | N/A | @@ -31,4 +31,6 @@ | `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A | | `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | -| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A | +| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A | +| `modalities` | List[[components.Modality](../components/modality.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamsimageconfig.md b/docs/components/chatgenerationparamsimageconfig.md new file mode 100644 index 0000000..18403aa --- /dev/null +++ b/docs/components/chatgenerationparamsimageconfig.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsImageConfig + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/components/chatgenerationparamspluginautorouter.md b/docs/components/chatgenerationparamspluginautorouter.md new file mode 100644 index 0000000..7326614 --- /dev/null +++ b/docs/components/chatgenerationparamspluginautorouter.md @@ -0,0 +1,10 @@ +# ChatGenerationParamsPluginAutoRouter + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `id` | *Literal["auto-router"]* | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspluginfileparser.md b/docs/components/chatgenerationparamspluginfileparser.md index f438508..9d53438 100644 --- a/docs/components/chatgenerationparamspluginfileparser.md +++ b/docs/components/chatgenerationparamspluginfileparser.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *Literal["file-parser"]* | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `pdf` | [Optional[components.ChatGenerationParamsPdf]](../components/chatgenerationparamspdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *Literal["file-parser"]* | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `pdf` | [Optional[components.Pdf]](../components/pdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspluginunion.md b/docs/components/chatgenerationparamspluginunion.md index 97ccfb1..5457d76 100644 --- a/docs/components/chatgenerationparamspluginunion.md +++ b/docs/components/chatgenerationparamspluginunion.md @@ -3,6 +3,12 @@ ## Supported Types +### `components.ChatGenerationParamsPluginAutoRouter` + +```python +value: components.ChatGenerationParamsPluginAutoRouter = /* values here */ +``` + ### `components.ChatGenerationParamsPluginModeration` ```python diff --git a/docs/components/chatgenerationparamspluginweb.md b/docs/components/chatgenerationparamspluginweb.md index 890c505..e495619 100644 --- a/docs/components/chatgenerationparamspluginweb.md +++ b/docs/components/chatgenerationparamspluginweb.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `id` | *Literal["web"]* | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `engine` | [Optional[components.ChatGenerationParamsEngine]](../components/chatgenerationparamsengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `id` | *Literal["web"]* | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `engine` | [Optional[components.Engine]](../components/engine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspreferredmaxlatency.md b/docs/components/chatgenerationparamspreferredmaxlatency.md new file mode 100644 index 0000000..323b2f9 --- /dev/null +++ b/docs/components/chatgenerationparamspreferredmaxlatency.md @@ -0,0 +1,11 @@ +# ChatGenerationParamsPreferredMaxLatency + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspreferredmaxlatencyunion.md b/docs/components/chatgenerationparamspreferredmaxlatencyunion.md new file mode 100644 index 0000000..3b22111 --- /dev/null +++ b/docs/components/chatgenerationparamspreferredmaxlatencyunion.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsPreferredMaxLatencyUnion + + +## Supported Types + +### `float` + +```python +value: float = /* values here */ +``` + +### `components.ChatGenerationParamsPreferredMaxLatency` + +```python +value: components.ChatGenerationParamsPreferredMaxLatency = /* values here */ +``` + diff --git a/docs/components/chatgenerationparamspreferredminthroughput.md b/docs/components/chatgenerationparamspreferredminthroughput.md new file mode 100644 index 0000000..260394d --- /dev/null +++ b/docs/components/chatgenerationparamspreferredminthroughput.md @@ -0,0 +1,11 @@ +# ChatGenerationParamsPreferredMinThroughput + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | +| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatgenerationparamspreferredminthroughputunion.md b/docs/components/chatgenerationparamspreferredminthroughputunion.md new file mode 100644 index 0000000..3803e24 --- /dev/null +++ b/docs/components/chatgenerationparamspreferredminthroughputunion.md @@ -0,0 +1,17 @@ +# ChatGenerationParamsPreferredMinThroughputUnion + + +## Supported Types + +### `float` + +```python +value: float = /* values here */ +``` + +### `components.ChatGenerationParamsPreferredMinThroughput` + +```python +value: components.ChatGenerationParamsPreferredMinThroughput = /* values here */ +``` + diff --git a/docs/components/chatgenerationparamsprovider.md b/docs/components/chatgenerationparamsprovider.md index 7dc2bc8..3d486fa 100644 --- a/docs/components/chatgenerationparamsprovider.md +++ b/docs/components/chatgenerationparamsprovider.md @@ -3,18 +3,18 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| -| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | -| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | -| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | -| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | -| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | -| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | -| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | -| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | -| `sort` | [OptionalNullable[components.Sort]](../components/sort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | -| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | -| `min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. | -| `max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| +| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | +| `data_collection` | [OptionalNullable[components.ChatGenerationParamsDataCollection]](../components/chatgenerationparamsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | +| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `order` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | +| `only` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | +| `ignore` | List[[components.Schema0](../components/schema0.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | +| `quantizations` | List[[components.Quantizations](../components/quantizations.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | +| `sort` | [OptionalNullable[components.ProviderSortUnion]](../components/providersortunion.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | +| `max_price` | [Optional[components.ChatGenerationParamsMaxPrice]](../components/chatgenerationparamsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | +| `preferred_min_throughput` | [OptionalNullable[components.ChatGenerationParamsPreferredMinThroughputUnion]](../components/chatgenerationparamspreferredminthroughputunion.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | +| `preferred_max_latency` | [OptionalNullable[components.ChatGenerationParamsPreferredMaxLatencyUnion]](../components/chatgenerationparamspreferredmaxlatencyunion.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | \ No newline at end of file diff --git a/docs/components/chatresponsechoice.md b/docs/components/chatresponsechoice.md index 54b4a32..82a46e5 100644 --- a/docs/components/chatresponsechoice.md +++ b/docs/components/chatresponsechoice.md @@ -8,4 +8,5 @@ | `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | | `index` | *float* | :heavy_check_mark: | N/A | | `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | N/A | +| `reasoning_details` | List[[components.Schema3](../components/schema3.md)] | :heavy_minus_sign: | N/A | | `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatstreamingmessagechunk.md b/docs/components/chatstreamingmessagechunk.md index ceada75..9d622a2 100644 --- a/docs/components/chatstreamingmessagechunk.md +++ b/docs/components/chatstreamingmessagechunk.md @@ -9,4 +9,5 @@ | `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A | +| `reasoning_details` | List[[components.Schema3](../components/schema3.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/effort.md b/docs/components/effort.md index 9d2261a..acf9c82 100644 --- a/docs/components/effort.md +++ b/docs/components/effort.md @@ -5,9 +5,9 @@ | Name | Value | | --------- | --------- | -| `NONE` | none | -| `MINIMAL` | minimal | -| `LOW` | low | -| `MEDIUM` | medium | +| `XHIGH` | xhigh | | `HIGH` | high | -| `XHIGH` | xhigh | \ No newline at end of file +| `MEDIUM` | medium | +| `LOW` | low | +| `MINIMAL` | minimal | +| `NONE` | none | \ No newline at end of file diff --git a/docs/components/engine.md b/docs/components/engine.md new file mode 100644 index 0000000..fcea19c --- /dev/null +++ b/docs/components/engine.md @@ -0,0 +1,9 @@ +# Engine + + +## Values + +| Name | Value | +| -------- | -------- | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/components/idautorouter.md b/docs/components/idautorouter.md new file mode 100644 index 0000000..43f83e5 --- /dev/null +++ b/docs/components/idautorouter.md @@ -0,0 +1,8 @@ +# IDAutoRouter + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `AUTO_ROUTER` | auto-router | \ No newline at end of file diff --git a/docs/components/modality.md b/docs/components/modality.md new file mode 100644 index 0000000..4edb378 --- /dev/null +++ b/docs/components/modality.md @@ -0,0 +1,9 @@ +# Modality + + +## Values + +| Name | Value | +| ------- | ------- | +| `TEXT` | text | +| `IMAGE` | image | \ No newline at end of file diff --git a/docs/components/openresponsesreasoningformat.md b/docs/components/openresponsesreasoningformat.md index 1d3f96a..dbf0b1a 100644 --- a/docs/components/openresponsesreasoningformat.md +++ b/docs/components/openresponsesreasoningformat.md @@ -3,10 +3,11 @@ ## Values -| Name | Value | -| --------------------- | --------------------- | -| `UNKNOWN` | unknown | -| `OPENAI_RESPONSES_V1` | openai-responses-v1 | -| `XAI_RESPONSES_V1` | xai-responses-v1 | -| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | -| `GOOGLE_GEMINI_V1` | google-gemini-v1 | \ No newline at end of file +| Name | Value | +| --------------------------- | --------------------------- | +| `UNKNOWN` | unknown | +| `OPENAI_RESPONSES_V1` | openai-responses-v1 | +| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 | +| `XAI_RESPONSES_V1` | xai-responses-v1 | +| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | +| `GOOGLE_GEMINI_V1` | google-gemini-v1 | \ No newline at end of file diff --git a/docs/components/openresponsesrequest.md b/docs/components/openresponsesrequest.md index 3803f4e..7d7e224 100644 --- a/docs/components/openresponsesrequest.md +++ b/docs/components/openresponsesrequest.md @@ -21,6 +21,8 @@ Request schema for Responses endpoint | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | | +| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9"
} | +| `modalities` | List[[components.ResponsesOutputModality](../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | | @@ -33,6 +35,5 @@ Request schema for Responses endpoint | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | | `provider` | [OptionalNullable[components.OpenResponsesRequestProvider]](../components/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `plugins` | List[[components.OpenResponsesRequestPluginUnion](../components/openresponsesrequestpluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | -| `route` | [OptionalNullable[components.OpenResponsesRequestRoute]](../components/openresponsesrequestroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | | | `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | \ No newline at end of file diff --git a/docs/components/openresponsesrequestignore.md b/docs/components/openresponsesrequestignore.md new file mode 100644 index 0000000..4528330 --- /dev/null +++ b/docs/components/openresponsesrequestignore.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestIgnore + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/openresponsesrequestimageconfig.md b/docs/components/openresponsesrequestimageconfig.md new file mode 100644 index 0000000..0bfb1b7 --- /dev/null +++ b/docs/components/openresponsesrequestimageconfig.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestImageConfig + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + diff --git a/docs/components/openresponsesrequestonly.md b/docs/components/openresponsesrequestonly.md new file mode 100644 index 0000000..d1ee630 --- /dev/null +++ b/docs/components/openresponsesrequestonly.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestOnly + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/openresponsesrequestorder.md b/docs/components/openresponsesrequestorder.md new file mode 100644 index 0000000..50da1f9 --- /dev/null +++ b/docs/components/openresponsesrequestorder.md @@ -0,0 +1,17 @@ +# OpenResponsesRequestOrder + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/openresponsesrequestpluginautorouter.md b/docs/components/openresponsesrequestpluginautorouter.md new file mode 100644 index 0000000..21de153 --- /dev/null +++ b/docs/components/openresponsesrequestpluginautorouter.md @@ -0,0 +1,10 @@ +# OpenResponsesRequestPluginAutoRouter + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | [components.IDAutoRouter](../components/idautorouter.md) | :heavy_check_mark: | N/A | | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the auto-router plugin for this request. Defaults to true. | | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. | [
"anthropic/*",
"openai/gpt-4o",
"google/*"
] | \ No newline at end of file diff --git a/docs/components/openresponsesrequestpluginfileparser.md b/docs/components/openresponsesrequestpluginfileparser.md index aee432a..34d0801 100644 --- a/docs/components/openresponsesrequestpluginfileparser.md +++ b/docs/components/openresponsesrequestpluginfileparser.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | [components.IDFileParser](../components/idfileparser.md) | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. | -| `pdf` | [Optional[components.OpenResponsesRequestPdf]](../components/openresponsesrequestpdf.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `id` | [components.IDFileParser](../components/idfileparser.md) | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the file-parser plugin for this request. Defaults to true. | +| `pdf` | [Optional[components.PDFParserOptions]](../components/pdfparseroptions.md) | :heavy_minus_sign: | Options for PDF parsing. | \ No newline at end of file diff --git a/docs/components/openresponsesrequestpluginunion.md b/docs/components/openresponsesrequestpluginunion.md index ead57c3..e164b2e 100644 --- a/docs/components/openresponsesrequestpluginunion.md +++ b/docs/components/openresponsesrequestpluginunion.md @@ -3,6 +3,12 @@ ## Supported Types +### `components.OpenResponsesRequestPluginAutoRouter` + +```python +value: components.OpenResponsesRequestPluginAutoRouter = /* values here */ +``` + ### `components.OpenResponsesRequestPluginModeration` ```python diff --git a/docs/components/openresponsesrequestpluginweb.md b/docs/components/openresponsesrequestpluginweb.md index 5d8fa30..2223caf 100644 --- a/docs/components/openresponsesrequestpluginweb.md +++ b/docs/components/openresponsesrequestpluginweb.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `id` | [components.IDWeb](../components/idweb.md) | :heavy_check_mark: | N/A | -| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | -| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `engine` | [Optional[components.OpenResponsesRequestEngine]](../components/openresponsesrequestengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `id` | [components.IDWeb](../components/idweb.md) | :heavy_check_mark: | N/A | +| `enabled` | *Optional[bool]* | :heavy_minus_sign: | Set to false to disable the web-search plugin for this request. Defaults to true. | +| `max_results` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `search_prompt` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `engine` | [Optional[components.WebSearchEngine]](../components/websearchengine.md) | :heavy_minus_sign: | The search engine to use for web search. | \ No newline at end of file diff --git a/docs/components/openresponsesrequestprovider.md b/docs/components/openresponsesrequestprovider.md index d5910b1..5fde781 100644 --- a/docs/components/openresponsesrequestprovider.md +++ b/docs/components/openresponsesrequestprovider.md @@ -5,18 +5,18 @@ When multiple model providers are available, optionally indicate your routing pr ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | -| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | -| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | -| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | -| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | -| `order` | List[[components.Order](../components/order.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | | -| `only` | List[[components.Only](../components/only.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | | -| `ignore` | List[[components.Ignore](../components/ignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | -| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | -| `sort` | [OptionalNullable[components.ProviderSort]](../components/providersort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | -| `max_price` | [Optional[components.OpenResponsesRequestMaxPrice]](../components/openresponsesrequestmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | -| `min_throughput` | *OptionalNullable[float]* | :heavy_minus_sign: | The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used. | 100 | -| `max_latency` | *OptionalNullable[float]* | :heavy_minus_sign: | The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used. | 5 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | +| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | +| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | +| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | +| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | +| `order` | List[[components.OpenResponsesRequestOrder](../components/openresponsesrequestorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | | +| `only` | List[[components.OpenResponsesRequestOnly](../components/openresponsesrequestonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | | +| `ignore` | List[[components.OpenResponsesRequestIgnore](../components/openresponsesrequestignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | +| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | +| `sort` | [OptionalNullable[components.OpenResponsesRequestSort]](../components/openresponsesrequestsort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price | +| `max_price` | [Optional[components.OpenResponsesRequestMaxPrice]](../components/openresponsesrequestmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | +| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 | +| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 | \ No newline at end of file diff --git a/docs/components/openresponsesrequestsort.md b/docs/components/openresponsesrequestsort.md new file mode 100644 index 0000000..3fd9dc7 --- /dev/null +++ b/docs/components/openresponsesrequestsort.md @@ -0,0 +1,25 @@ +# OpenResponsesRequestSort + +The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + + +## Supported Types + +### `components.ProviderSort` + +```python +value: components.ProviderSort = /* values here */ +``` + +### `components.ProviderSortConfig` + +```python +value: components.ProviderSortConfig = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/parameter.md b/docs/components/parameter.md index 3640dfa..b638d09 100644 --- a/docs/components/parameter.md +++ b/docs/components/parameter.md @@ -26,5 +26,6 @@ | `PARALLEL_TOOL_CALLS` | parallel_tool_calls | | `INCLUDE_REASONING` | include_reasoning | | `REASONING` | reasoning | +| `REASONING_EFFORT` | reasoning_effort | | `WEB_SEARCH_OPTIONS` | web_search_options | | `VERBOSITY` | verbosity | \ No newline at end of file diff --git a/docs/components/partition.md b/docs/components/partition.md new file mode 100644 index 0000000..975706f --- /dev/null +++ b/docs/components/partition.md @@ -0,0 +1,9 @@ +# Partition + + +## Values + +| Name | Value | +| ------- | ------- | +| `MODEL` | model | +| `NONE` | none | \ No newline at end of file diff --git a/docs/components/pdf.md b/docs/components/pdf.md new file mode 100644 index 0000000..b039762 --- /dev/null +++ b/docs/components/pdf.md @@ -0,0 +1,8 @@ +# Pdf + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `engine` | [Optional[components.PdfEngine]](../components/pdfengine.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/pdfengine.md b/docs/components/pdfengine.md new file mode 100644 index 0000000..55bca5e --- /dev/null +++ b/docs/components/pdfengine.md @@ -0,0 +1,10 @@ +# PdfEngine + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `MISTRAL_OCR` | mistral-ocr | +| `PDF_TEXT` | pdf-text | +| `NATIVE` | native | \ No newline at end of file diff --git a/docs/components/pdfparserengine.md b/docs/components/pdfparserengine.md new file mode 100644 index 0000000..8d3c25c --- /dev/null +++ b/docs/components/pdfparserengine.md @@ -0,0 +1,12 @@ +# PDFParserEngine + +The engine to use for parsing PDF files. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `MISTRAL_OCR` | mistral-ocr | +| `PDF_TEXT` | pdf-text | +| `NATIVE` | native | \ No newline at end of file diff --git a/docs/components/pdfparseroptions.md b/docs/components/pdfparseroptions.md new file mode 100644 index 0000000..3718a3d --- /dev/null +++ b/docs/components/pdfparseroptions.md @@ -0,0 +1,10 @@ +# PDFParserOptions + +Options for PDF parsing. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `engine` | [Optional[components.PDFParserEngine]](../components/pdfparserengine.md) | :heavy_minus_sign: | The engine to use for parsing PDF files. | \ No newline at end of file diff --git a/docs/components/percentilelatencycutoffs.md b/docs/components/percentilelatencycutoffs.md new file mode 100644 index 0000000..6a2c04f --- /dev/null +++ b/docs/components/percentilelatencycutoffs.md @@ -0,0 +1,13 @@ +# PercentileLatencyCutoffs + +Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p50 latency (seconds) | +| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p75 latency (seconds) | +| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p90 latency (seconds) | +| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Maximum p99 latency (seconds) | \ No newline at end of file diff --git a/docs/components/percentilestats.md b/docs/components/percentilestats.md new file mode 100644 index 0000000..db0cccb --- /dev/null +++ b/docs/components/percentilestats.md @@ -0,0 +1,13 @@ +# PercentileStats + +Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `p50` | *float* | :heavy_check_mark: | Median (50th percentile) | 25.5 | +| `p75` | *float* | :heavy_check_mark: | 75th percentile | 35.2 | +| `p90` | *float* | :heavy_check_mark: | 90th percentile | 48.7 | +| `p99` | *float* | :heavy_check_mark: | 99th percentile | 85.3 | \ No newline at end of file diff --git a/docs/components/percentilethroughputcutoffs.md b/docs/components/percentilethroughputcutoffs.md new file mode 100644 index 0000000..dff209d --- /dev/null +++ b/docs/components/percentilethroughputcutoffs.md @@ -0,0 +1,13 @@ +# PercentileThroughputCutoffs + +Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `p50` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p50 throughput (tokens/sec) | +| `p75` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p75 throughput (tokens/sec) | +| `p90` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p90 throughput (tokens/sec) | +| `p99` | *OptionalNullable[float]* | :heavy_minus_sign: | Minimum p99 throughput (tokens/sec) | \ No newline at end of file diff --git a/docs/components/preferredmaxlatency.md b/docs/components/preferredmaxlatency.md new file mode 100644 index 0000000..ce96e64 --- /dev/null +++ b/docs/components/preferredmaxlatency.md @@ -0,0 +1,25 @@ +# PreferredMaxLatency + +Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + + +## Supported Types + +### `float` + +```python +value: float = /* values here */ +``` + +### `components.PercentileLatencyCutoffs` + +```python +value: components.PercentileLatencyCutoffs = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/preferredminthroughput.md b/docs/components/preferredminthroughput.md new file mode 100644 index 0000000..fd49bf8 --- /dev/null +++ b/docs/components/preferredminthroughput.md @@ -0,0 +1,25 @@ +# PreferredMinThroughput + +Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. + + +## Supported Types + +### `float` + +```python +value: float = /* values here */ +``` + +### `components.PercentileThroughputCutoffs` + +```python +value: components.PercentileThroughputCutoffs = /* values here */ +``` + +### `Any` + +```python +value: Any = /* values here */ +``` + diff --git a/docs/components/prompttokensdetails.md b/docs/components/prompttokensdetails.md index a7248a0..844a92d 100644 --- a/docs/components/prompttokensdetails.md +++ b/docs/components/prompttokensdetails.md @@ -3,8 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `cached_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `audio_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | -| `video_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `cached_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `cache_write_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `audio_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `video_tokens` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/providername.md b/docs/components/providername.md index 3f2d1f7..f4a2f7a 100644 --- a/docs/components/providername.md +++ b/docs/components/providername.md @@ -31,7 +31,6 @@ | `FIREWORKS` | Fireworks | | `FRIENDLI` | Friendli | | `GMI_CLOUD` | GMICloud | -| `GO_POMELO` | GoPomelo | | `GOOGLE` | Google | | `GOOGLE_AI_STUDIO` | Google AI Studio | | `GROQ` | Groq | @@ -61,13 +60,14 @@ | `PHALA` | Phala | | `RELACE` | Relace | | `SAMBA_NOVA` | SambaNova | +| `SEED` | Seed | | `SILICON_FLOW` | SiliconFlow | | `SOURCEFUL` | Sourceful | | `STEALTH` | Stealth | | `STREAM_LAKE` | StreamLake | | `SWITCHPOINT` | Switchpoint | -| `TARGON` | Targon | | `TOGETHER` | Together | +| `UPSTAGE` | Upstage | | `VENICE` | Venice | | `WAND_B` | WandB | | `XIAOMI` | Xiaomi | diff --git a/docs/components/providerpreferences.md b/docs/components/providerpreferences.md new file mode 100644 index 0000000..bb33997 --- /dev/null +++ b/docs/components/providerpreferences.md @@ -0,0 +1,22 @@ +# ProviderPreferences + +Provider routing preferences for the request. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests
- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.
- false: use only the primary/custom provider, and return the upstream error if it's unavailable.
| | +| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | | +| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it

- deny: use only providers which do not collect user data. | allow | +| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true | +| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true | +| `order` | List[[components.ProviderPreferencesOrder](../components/providerpreferencesorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | | +| `only` | List[[components.ProviderPreferencesOnly](../components/providerpreferencesonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | | +| `ignore` | List[[components.ProviderPreferencesIgnore](../components/providerpreferencesignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | | +| `quantizations` | List[[components.Quantization](../components/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | | +| `sort` | [OptionalNullable[components.ProviderPreferencesSortUnion]](../components/providerpreferencessortunion.md) | :heavy_minus_sign: | N/A | | +| `max_price` | [Optional[components.ProviderPreferencesMaxPrice]](../components/providerpreferencesmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | | +| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.md) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 | +| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.md) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 | \ No newline at end of file diff --git a/docs/components/providerpreferencesignore.md b/docs/components/providerpreferencesignore.md new file mode 100644 index 0000000..2d18b70 --- /dev/null +++ b/docs/components/providerpreferencesignore.md @@ -0,0 +1,17 @@ +# ProviderPreferencesIgnore + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/providerpreferencesmaxprice.md b/docs/components/providerpreferencesmaxprice.md new file mode 100644 index 0000000..99f99dc --- /dev/null +++ b/docs/components/providerpreferencesmaxprice.md @@ -0,0 +1,14 @@ +# ProviderPreferencesMaxPrice + +The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `prompt` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `completion` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `image` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `request` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | \ No newline at end of file diff --git a/docs/components/providerpreferencesonly.md b/docs/components/providerpreferencesonly.md new file mode 100644 index 0000000..be68765 --- /dev/null +++ b/docs/components/providerpreferencesonly.md @@ -0,0 +1,17 @@ +# ProviderPreferencesOnly + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/providerpreferencesorder.md b/docs/components/providerpreferencesorder.md new file mode 100644 index 0000000..ccc7218 --- /dev/null +++ b/docs/components/providerpreferencesorder.md @@ -0,0 +1,17 @@ +# ProviderPreferencesOrder + + +## Supported Types + +### `components.ProviderName` + +```python +value: components.ProviderName = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/components/providerpreferencespartition.md b/docs/components/providerpreferencespartition.md new file mode 100644 index 0000000..dab9b83 --- /dev/null +++ b/docs/components/providerpreferencespartition.md @@ -0,0 +1,9 @@ +# ProviderPreferencesPartition + + +## Values + +| Name | Value | +| ------- | ------- | +| `MODEL` | model | +| `NONE` | none | \ No newline at end of file diff --git a/docs/components/providerpreferencesprovidersort.md b/docs/components/providerpreferencesprovidersort.md new file mode 100644 index 0000000..9d8bac3 --- /dev/null +++ b/docs/components/providerpreferencesprovidersort.md @@ -0,0 +1,10 @@ +# ProviderPreferencesProviderSort + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `PRICE` | price | +| `THROUGHPUT` | throughput | +| `LATENCY` | latency | \ No newline at end of file diff --git a/docs/components/providerpreferencesprovidersortconfig.md b/docs/components/providerpreferencesprovidersortconfig.md new file mode 100644 index 0000000..1b9ed9c --- /dev/null +++ b/docs/components/providerpreferencesprovidersortconfig.md @@ -0,0 +1,9 @@ +# ProviderPreferencesProviderSortConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `by` | [OptionalNullable[components.ProviderSort]](../components/providersort.md) | :heavy_minus_sign: | N/A | price | +| `partition` | [OptionalNullable[components.ProviderPreferencesPartition]](../components/providerpreferencespartition.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/providerpreferencessortunion.md b/docs/components/providerpreferencessortunion.md new file mode 100644 index 0000000..e25b117 --- /dev/null +++ b/docs/components/providerpreferencessortunion.md @@ -0,0 +1,25 @@ +# ProviderPreferencesSortUnion + +The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + + +## Supported Types + +### `components.ProviderPreferencesProviderSort` + +```python +value: components.ProviderPreferencesProviderSort = /* values here */ +``` + +### `components.ProviderSortConfigUnion` + +```python +value: components.ProviderSortConfigUnion = /* values here */ +``` + +### `components.SortEnum` + +```python +value: components.SortEnum = /* values here */ +``` + diff --git a/docs/components/providersort.md b/docs/components/providersort.md index 771741f..f6d1c72 100644 --- a/docs/components/providersort.md +++ b/docs/components/providersort.md @@ -1,7 +1,5 @@ # ProviderSort -The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. - ## Values diff --git a/docs/components/providersortconfig.md b/docs/components/providersortconfig.md new file mode 100644 index 0000000..a010a19 --- /dev/null +++ b/docs/components/providersortconfig.md @@ -0,0 +1,9 @@ +# ProviderSortConfig + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `by` | [OptionalNullable[components.ProviderSort]](../components/providersort.md) | :heavy_minus_sign: | N/A | price | +| `partition` | [OptionalNullable[components.Partition]](../components/partition.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/components/providersortconfigenum.md b/docs/components/providersortconfigenum.md new file mode 100644 index 0000000..4aca83d --- /dev/null +++ b/docs/components/providersortconfigenum.md @@ -0,0 +1,10 @@ +# ProviderSortConfigEnum + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `PRICE` | price | +| `THROUGHPUT` | throughput | +| `LATENCY` | latency | \ No newline at end of file diff --git a/docs/components/providersortconfigunion.md b/docs/components/providersortconfigunion.md new file mode 100644 index 0000000..6a9b42b --- /dev/null +++ b/docs/components/providersortconfigunion.md @@ -0,0 +1,17 @@ +# ProviderSortConfigUnion + + +## Supported Types + +### `components.ProviderPreferencesProviderSortConfig` + +```python +value: components.ProviderPreferencesProviderSortConfig = /* values here */ +``` + +### `components.ProviderSortConfigEnum` + +```python +value: components.ProviderSortConfigEnum = /* values here */ +``` + diff --git a/docs/components/providersortunion.md b/docs/components/providersortunion.md new file mode 100644 index 0000000..9cd4d04 --- /dev/null +++ b/docs/components/providersortunion.md @@ -0,0 +1,17 @@ +# ProviderSortUnion + + +## Supported Types + +### `components.ProviderSort` + +```python +value: components.ProviderSort = /* values here */ +``` + +### `components.ProviderSortConfig` + +```python +value: components.ProviderSortConfig = /* values here */ +``` + diff --git a/docs/components/publicendpoint.md b/docs/components/publicendpoint.md index 3f39e39..bff4d4e 100644 --- a/docs/components/publicendpoint.md +++ b/docs/components/publicendpoint.md @@ -19,4 +19,6 @@ Information about a specific model endpoint | `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | N/A | | | `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 | | `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | -| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | \ No newline at end of file +| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | +| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. | | +| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/components/responsesoutputitemreasoning.md b/docs/components/responsesoutputitemreasoning.md index 986ba71..093a7cb 100644 --- a/docs/components/responsesoutputitemreasoning.md +++ b/docs/components/responsesoutputitemreasoning.md @@ -5,11 +5,13 @@ An output item containing reasoning ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | N/A | -| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A | -| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `status` | [Optional[components.ResponsesOutputItemReasoningStatusUnion]](../components/responsesoutputitemreasoningstatusunion.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `type` | [components.ResponsesOutputItemReasoningType](../components/responsesoutputitemreasoningtype.md) | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.md)] | :heavy_minus_sign: | N/A | | +| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.md)] | :heavy_check_mark: | N/A | | +| `encrypted_content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `status` | [Optional[components.ResponsesOutputItemReasoningStatusUnion]](../components/responsesoutputitemreasoningstatusunion.md) | :heavy_minus_sign: | N/A | | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | +| `format_` | [OptionalNullable[components.ResponsesOutputItemReasoningFormat]](../components/responsesoutputitemreasoningformat.md) | :heavy_minus_sign: | The format of the reasoning content | anthropic-claude-v1 | \ No newline at end of file diff --git a/docs/components/responsesoutputitemreasoningformat.md b/docs/components/responsesoutputitemreasoningformat.md new file mode 100644 index 0000000..d3ea6ee --- /dev/null +++ b/docs/components/responsesoutputitemreasoningformat.md @@ -0,0 +1,15 @@ +# ResponsesOutputItemReasoningFormat + +The format of the reasoning content + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `UNKNOWN` | unknown | +| `OPENAI_RESPONSES_V1` | openai-responses-v1 | +| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 | +| `XAI_RESPONSES_V1` | xai-responses-v1 | +| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | +| `GOOGLE_GEMINI_V1` | google-gemini-v1 | \ No newline at end of file diff --git a/docs/components/responsesoutputmodality.md b/docs/components/responsesoutputmodality.md new file mode 100644 index 0000000..f94f6c1 --- /dev/null +++ b/docs/components/responsesoutputmodality.md @@ -0,0 +1,9 @@ +# ResponsesOutputModality + + +## Values + +| Name | Value | +| ------- | ------- | +| `TEXT` | text | +| `IMAGE` | image | \ No newline at end of file diff --git a/docs/components/route.md b/docs/components/route.md new file mode 100644 index 0000000..6ddb804 --- /dev/null +++ b/docs/components/route.md @@ -0,0 +1,9 @@ +# Route + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `FALLBACK` | fallback | +| `SORT` | sort | \ No newline at end of file diff --git a/docs/components/schema0enum.md b/docs/components/schema0enum.md index 92e5d2f..d59e27a 100644 --- a/docs/components/schema0enum.md +++ b/docs/components/schema0enum.md @@ -31,7 +31,6 @@ | `FIREWORKS` | Fireworks | | `FRIENDLI` | Friendli | | `GMI_CLOUD` | GMICloud | -| `GO_POMELO` | GoPomelo | | `GOOGLE` | Google | | `GOOGLE_AI_STUDIO` | Google AI Studio | | `GROQ` | Groq | @@ -61,13 +60,14 @@ | `PHALA` | Phala | | `RELACE` | Relace | | `SAMBA_NOVA` | SambaNova | +| `SEED` | Seed | | `SILICON_FLOW` | SiliconFlow | | `SOURCEFUL` | Sourceful | | `STEALTH` | Stealth | | `STREAM_LAKE` | StreamLake | | `SWITCHPOINT` | Switchpoint | -| `TARGON` | Targon | | `TOGETHER` | Together | +| `UPSTAGE` | Upstage | | `VENICE` | Venice | | `WAND_B` | WandB | | `XIAOMI` | Xiaomi | diff --git a/docs/components/schema3.md b/docs/components/schema3.md new file mode 100644 index 0000000..afe2a72 --- /dev/null +++ b/docs/components/schema3.md @@ -0,0 +1,23 @@ +# Schema3 + + +## Supported Types + +### `components.Schema3ReasoningSummary` + +```python +value: components.Schema3ReasoningSummary = /* values here */ +``` + +### `components.Schema3ReasoningEncrypted` + +```python +value: components.Schema3ReasoningEncrypted = /* values here */ +``` + +### `components.Schema3ReasoningText` + +```python +value: components.Schema3ReasoningText = /* values here */ +``` + diff --git a/docs/components/schema3reasoningencrypted.md b/docs/components/schema3reasoningencrypted.md new file mode 100644 index 0000000..1441d0d --- /dev/null +++ b/docs/components/schema3reasoningencrypted.md @@ -0,0 +1,12 @@ +# Schema3ReasoningEncrypted + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A | +| `data` | *str* | :heavy_check_mark: | N/A | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema3reasoningsummary.md b/docs/components/schema3reasoningsummary.md new file mode 100644 index 0000000..d5e348d --- /dev/null +++ b/docs/components/schema3reasoningsummary.md @@ -0,0 +1,12 @@ +# Schema3ReasoningSummary + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A | +| `summary` | *str* | :heavy_check_mark: | N/A | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema3reasoningtext.md b/docs/components/schema3reasoningtext.md new file mode 100644 index 0000000..d64ae86 --- /dev/null +++ b/docs/components/schema3reasoningtext.md @@ -0,0 +1,13 @@ +# Schema3ReasoningText + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | *Literal["reasoning.text"]* | :heavy_check_mark: | N/A | +| `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema5.md b/docs/components/schema5.md new file mode 100644 index 0000000..64eb2b3 --- /dev/null +++ b/docs/components/schema5.md @@ -0,0 +1,13 @@ +# Schema5 + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `UNKNOWN` | unknown | +| `OPENAI_RESPONSES_V1` | openai-responses-v1 | +| `AZURE_OPENAI_RESPONSES_V1` | azure-openai-responses-v1 | +| `XAI_RESPONSES_V1` | xai-responses-v1 | +| `ANTHROPIC_CLAUDE_V1` | anthropic-claude-v1 | +| `GOOGLE_GEMINI_V1` | google-gemini-v1 | \ No newline at end of file diff --git a/docs/components/sortenum.md b/docs/components/sortenum.md new file mode 100644 index 0000000..728cf4b --- /dev/null +++ b/docs/components/sortenum.md @@ -0,0 +1,10 @@ +# SortEnum + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `PRICE` | price | +| `THROUGHPUT` | throughput | +| `LATENCY` | latency | \ No newline at end of file diff --git a/docs/components/websearchengine.md b/docs/components/websearchengine.md new file mode 100644 index 0000000..0b843a8 --- /dev/null +++ b/docs/components/websearchengine.md @@ -0,0 +1,11 @@ +# WebSearchEngine + +The search engine to use for web search. + + +## Values + +| Name | Value | +| -------- | -------- | +| `NATIVE` | native | +| `EXA` | exa | \ No newline at end of file diff --git a/docs/operations/createembeddingsrequest.md b/docs/operations/createembeddingsrequest.md index 2226077..a799bcb 100644 --- a/docs/operations/createembeddingsrequest.md +++ b/docs/operations/createembeddingsrequest.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `input` | [operations.InputUnion](../operations/inputunion.md) | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | -| `encoding_format` | [Optional[operations.EncodingFormat]](../operations/encodingformat.md) | :heavy_minus_sign: | N/A | -| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `provider` | [Optional[operations.CreateEmbeddingsProvider]](../operations/createembeddingsprovider.md) | :heavy_minus_sign: | N/A | -| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `input` | [operations.InputUnion](../operations/inputunion.md) | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `encoding_format` | [Optional[operations.EncodingFormat]](../operations/encodingformat.md) | :heavy_minus_sign: | N/A | +| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `provider` | [Optional[components.ProviderPreferences]](../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. | +| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/operations/getparametersrequest.md b/docs/operations/getparametersrequest.md index e7fd937..6c24661 100644 --- a/docs/operations/getparametersrequest.md +++ b/docs/operations/getparametersrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `author` | *str* | :heavy_check_mark: | N/A | -| `slug` | *str* | :heavy_check_mark: | N/A | -| `provider` | [Optional[operations.GetParametersProvider]](../operations/getparametersprovider.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `author` | *str* | :heavy_check_mark: | N/A | | +| `slug` | *str* | :heavy_check_mark: | N/A | | +| `provider` | [Optional[components.ProviderName]](../components/providername.md) | :heavy_minus_sign: | N/A | OpenAI | \ No newline at end of file diff --git a/docs/operations/listendpointsresponse.md b/docs/operations/listendpointsresponse.md index cde8b93..d4a7a58 100644 --- a/docs/operations/listendpointsresponse.md +++ b/docs/operations/listendpointsresponse.md @@ -5,6 +5,6 @@ Returns a list of endpoints ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `data` | [components.ListEndpointsResponse](../components/listendpointsresponse.md) | :heavy_check_mark: | List of available endpoints for a model | {
"id": "openai/gpt-4",
"name": "GPT-4",
"created": 1692901234,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"architecture": {
"tokenizer": "GPT",
"instruct_type": "chatml",
"modality": "text-\u003etext",
"input_modalities": [
"text"
],
"output_modalities": [
"text"
]
},
"endpoints": [
{
"name": "OpenAI: GPT-4",
"model_name": "GPT-4",
"context_length": 8192,
"pricing": {
"prompt": "0.00003",
"completion": "0.00006",
"request": "0",
"image": "0"
},
"provider_name": "OpenAI",
"tag": "openai",
"quantization": "fp16",
"max_completion_tokens": 4096,
"max_prompt_tokens": 8192,
"supported_parameters": [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty"
],
"status": "default",
"uptime_last_30m": 99.5,
"supports_implicit_caching": true
}
]
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [components.ListEndpointsResponse](../components/listendpointsresponse.md) | :heavy_check_mark: | List of available endpoints for a model | {
"id": "openai/gpt-4",
"name": "GPT-4",
"created": 1692901234,
"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",
"architecture": {
"tokenizer": "GPT",
"instruct_type": "chatml",
"modality": "text-\u003etext",
"input_modalities": [
"text"
],
"output_modalities": [
"text"
]
},
"endpoints": [
{
"name": "OpenAI: GPT-4",
"model_name": "GPT-4",
"context_length": 8192,
"pricing": {
"prompt": "0.00003",
"completion": "0.00006",
"request": "0",
"image": "0"
},
"provider_name": "OpenAI",
"tag": "openai",
"quantization": "fp16",
"max_completion_tokens": 4096,
"max_prompt_tokens": 8192,
"supported_parameters": [
"temperature",
"top_p",
"max_tokens",
"frequency_penalty",
"presence_penalty"
],
"status": "default",
"uptime_last_30m": 99.5,
"supports_implicit_caching": true,
"latency_last_30m": {
"p50": 0.25,
"p75": 0.35,
"p90": 0.48,
"p99": 0.85
},
"throughput_last_30m": {
"p50": 45.2,
"p75": 38.5,
"p90": 28.3,
"p99": 15.1
}
}
]
} | \ No newline at end of file diff --git a/docs/operations/supportedparameter.md b/docs/operations/supportedparameter.md index 4d18fd1..219529f 100644 --- a/docs/operations/supportedparameter.md +++ b/docs/operations/supportedparameter.md @@ -26,5 +26,6 @@ | `PARALLEL_TOOL_CALLS` | parallel_tool_calls | | `INCLUDE_REASONING` | include_reasoning | | `REASONING` | reasoning | +| `REASONING_EFFORT` | reasoning_effort | | `WEB_SEARCH_OPTIONS` | web_search_options | | `VERBOSITY` | verbosity | \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index ab61108..6b781c3 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -39,7 +39,7 @@ with OpenRouter( | `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | N/A | | `provider` | [OptionalNullable[components.ChatGenerationParamsProvider]](../../components/chatgenerationparamsprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | `plugins` | List[[components.ChatGenerationParamsPluginUnion](../../components/chatgenerationparamspluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | -| `route` | [OptionalNullable[components.ChatGenerationParamsRoute]](../../components/chatgenerationparamsroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | +| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | `model` | *Optional[str]* | :heavy_minus_sign: | N/A | @@ -63,6 +63,8 @@ with OpenRouter( | `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A | +| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A | +| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/embeddings/README.md b/docs/sdks/embeddings/README.md index 4f4244b..9defe9a 100644 --- a/docs/sdks/embeddings/README.md +++ b/docs/sdks/embeddings/README.md @@ -35,16 +35,16 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `input` | [operations.InputUnion](../../operations/inputunion.md) | :heavy_check_mark: | N/A | -| `model` | *str* | :heavy_check_mark: | N/A | -| `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A | -| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A | -| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `provider` | [Optional[operations.CreateEmbeddingsProvider]](../../operations/createembeddingsprovider.md) | :heavy_minus_sign: | N/A | -| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `input` | [operations.InputUnion](../../operations/inputunion.md) | :heavy_check_mark: | N/A | +| `model` | *str* | :heavy_check_mark: | N/A | +| `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A | +| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `provider` | [Optional[components.ProviderPreferences]](../../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. | +| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/docs/sdks/parameters/README.md b/docs/sdks/parameters/README.md index 8ad31a4..41db61a 100644 --- a/docs/sdks/parameters/README.md +++ b/docs/sdks/parameters/README.md @@ -34,13 +34,13 @@ with OpenRouter() as open_router: ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `security` | [operations.GetParametersSecurity](../../operations/getparameterssecurity.md) | :heavy_check_mark: | N/A | -| `author` | *str* | :heavy_check_mark: | N/A | -| `slug` | *str* | :heavy_check_mark: | N/A | -| `provider` | [Optional[operations.GetParametersProvider]](../../operations/getparametersprovider.md) | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `security` | [operations.GetParametersSecurity](../../operations/getparameterssecurity.md) | :heavy_check_mark: | N/A | | +| `author` | *str* | :heavy_check_mark: | N/A | | +| `slug` | *str* | :heavy_check_mark: | N/A | | +| `provider` | [Optional[components.ProviderName]](../../components/providername.md) | :heavy_minus_sign: | N/A | OpenAI | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/responses/README.md b/docs/sdks/responses/README.md index 3fecb96..102a9d0 100644 --- a/docs/sdks/responses/README.md +++ b/docs/sdks/responses/README.md @@ -52,6 +52,8 @@ with OpenRouter( | `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | | `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | | +| `image_config` | Dict[str, [components.OpenResponsesRequestImageConfig](../../components/openresponsesrequestimageconfig.md)] | :heavy_minus_sign: | Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. | {
"aspect_ratio": "16:9"
} | +| `modalities` | List[[components.ResponsesOutputModality](../../components/responsesoutputmodality.md)] | :heavy_minus_sign: | Output modalities for the response. Supported values are "text" and "image". | [
"text",
"image"
] | | `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | | @@ -63,7 +65,6 @@ with OpenRouter( | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | | `provider` | [OptionalNullable[components.OpenResponsesRequestProvider]](../../components/openresponsesrequestprovider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `plugins` | List[[components.OpenResponsesRequestPluginUnion](../../components/openresponsesrequestpluginunion.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | | -| `route` | [OptionalNullable[components.OpenResponsesRequestRoute]](../../components/openresponsesrequestroute.md) | :heavy_minus_sign: | Routing strategy for multiple models: "fallback" (default) uses secondary models as backups, "sort" sorts all endpoints together by routing criteria. | | | `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | | | `session_id` | *Optional[str]* | :heavy_minus_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. | | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | diff --git a/examples/oauth_pkce_example.py b/examples/oauth_pkce_example.py index b394a7d..e07e3e3 100644 --- a/examples/oauth_pkce_example.py +++ b/examples/oauth_pkce_example.py @@ -7,12 +7,10 @@ """ from openrouter import OpenRouter -from openrouter.utils.oauth_create_sha256_code_challenge import ( +from openrouter.utils import ( oauth_create_sha256_code_challenge, - CreateSHA256CodeChallengeRequest, -) -from openrouter.utils.oauth_create_authorization_url import ( oauth_create_authorization_url, + CreateSHA256CodeChallengeRequest, CreateAuthorizationUrlRequestWithPKCE, ) diff --git a/pyproject.toml b/pyproject.toml index 0bca6bd..21d2698 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.0.16" +version = "0.0.17" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index af0bab6..3aacaa3 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.0.16" +__version__: str = "0.0.17" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.768.0" -__user_agent__: str = "speakeasy-sdk/python 0.0.16 2.768.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.0.17 2.768.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/chat.py b/src/openrouter/chat.py index f66c259..d75dbd2 100644 --- a/src/openrouter/chat.py +++ b/src/openrouter/chat.py @@ -33,7 +33,7 @@ def send( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -76,6 +76,13 @@ def send( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -88,7 +95,7 @@ def send( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -112,6 +119,8 @@ def send( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -136,7 +145,7 @@ def send( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -179,6 +188,13 @@ def send( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -191,7 +207,7 @@ def send( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -215,6 +231,8 @@ def send( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -238,7 +256,7 @@ def send( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -281,6 +299,13 @@ def send( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -293,7 +318,7 @@ def send( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -317,6 +342,8 @@ def send( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -374,6 +401,8 @@ def send( ), top_p=top_p, debug=utils.get_pydantic_model(debug, Optional[components.Debug]), + image_config=image_config, + modalities=modalities, ) req = self._build_request( @@ -480,7 +509,7 @@ async def send_async( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -523,6 +552,13 @@ async def send_async( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -535,7 +571,7 @@ async def send_async( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -559,6 +595,8 @@ async def send_async( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -583,7 +621,7 @@ async def send_async( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -626,6 +664,13 @@ async def send_async( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -638,7 +683,7 @@ async def send_async( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -662,6 +707,8 @@ async def send_async( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -685,7 +732,7 @@ async def send_async( List[components.ChatGenerationParamsPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.ChatGenerationParamsRoute] = UNSET, + route: OptionalNullable[components.Route] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, model: Optional[str] = None, @@ -728,6 +775,13 @@ async def send_async( ] = None, top_p: OptionalNullable[float] = UNSET, debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None, + image_config: Optional[ + Union[ + Dict[str, components.ChatGenerationParamsImageConfig], + Dict[str, components.ChatGenerationParamsImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.Modality]] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -740,7 +794,7 @@ async def send_async( :param messages: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. + :param route: :param user: :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param model: @@ -764,6 +818,8 @@ async def send_async( :param tools: :param top_p: :param debug: + :param image_config: + :param modalities: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -821,6 +877,8 @@ async def send_async( ), top_p=top_p, debug=utils.get_pydantic_model(debug, Optional[components.Debug]), + image_config=image_config, + modalities=modalities, ) req = self._build_request_async( diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index ed2cd19..ec10262 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -7,6 +7,17 @@ if TYPE_CHECKING: from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict + from ._schema3 import ( + Schema3, + Schema3ReasoningEncrypted, + Schema3ReasoningEncryptedTypedDict, + Schema3ReasoningSummary, + Schema3ReasoningSummaryTypedDict, + Schema3ReasoningText, + Schema3ReasoningTextTypedDict, + Schema3TypedDict, + Schema5, + ) from .activityitem import ActivityItem, ActivityItemTypedDict from .assistantmessage import ( AssistantMessage, @@ -27,12 +38,12 @@ from .chatgenerationparams import ( ChatGenerationParams, ChatGenerationParamsDataCollection, - ChatGenerationParamsEngine, + ChatGenerationParamsImageConfig, + ChatGenerationParamsImageConfigTypedDict, ChatGenerationParamsMaxPrice, ChatGenerationParamsMaxPriceTypedDict, - ChatGenerationParamsPdf, - ChatGenerationParamsPdfEngine, - ChatGenerationParamsPdfTypedDict, + ChatGenerationParamsPluginAutoRouter, + ChatGenerationParamsPluginAutoRouterTypedDict, ChatGenerationParamsPluginFileParser, ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginModeration, @@ -43,6 +54,14 @@ ChatGenerationParamsPluginUnionTypedDict, ChatGenerationParamsPluginWeb, ChatGenerationParamsPluginWebTypedDict, + ChatGenerationParamsPreferredMaxLatency, + ChatGenerationParamsPreferredMaxLatencyTypedDict, + ChatGenerationParamsPreferredMaxLatencyUnion, + ChatGenerationParamsPreferredMaxLatencyUnionTypedDict, + ChatGenerationParamsPreferredMinThroughput, + ChatGenerationParamsPreferredMinThroughputTypedDict, + ChatGenerationParamsPreferredMinThroughputUnion, + ChatGenerationParamsPreferredMinThroughputUnionTypedDict, ChatGenerationParamsProvider, ChatGenerationParamsProviderTypedDict, ChatGenerationParamsResponseFormatJSONObject, @@ -53,17 +72,21 @@ ChatGenerationParamsResponseFormatTextTypedDict, ChatGenerationParamsResponseFormatUnion, ChatGenerationParamsResponseFormatUnionTypedDict, - ChatGenerationParamsRoute, ChatGenerationParamsStop, ChatGenerationParamsStopTypedDict, ChatGenerationParamsTypedDict, Debug, DebugTypedDict, Effort, + Engine, + Modality, + Pdf, + PdfEngine, + PdfTypedDict, Quantizations, Reasoning, ReasoningTypedDict, - Sort, + Route, ) from .chatgenerationtokenusage import ( ChatGenerationTokenUsage, @@ -444,21 +467,24 @@ OpenResponsesReasoningSummaryTextDoneEventTypedDict, ) from .openresponsesrequest import ( + IDAutoRouter, IDFileParser, IDModeration, IDResponseHealing, IDWeb, - Ignore, - IgnoreTypedDict, - Only, - OnlyTypedDict, OpenResponsesRequest, - OpenResponsesRequestEngine, + OpenResponsesRequestIgnore, + OpenResponsesRequestIgnoreTypedDict, + OpenResponsesRequestImageConfig, + OpenResponsesRequestImageConfigTypedDict, OpenResponsesRequestMaxPrice, OpenResponsesRequestMaxPriceTypedDict, - OpenResponsesRequestPdf, - OpenResponsesRequestPdfEngine, - OpenResponsesRequestPdfTypedDict, + OpenResponsesRequestOnly, + OpenResponsesRequestOnlyTypedDict, + OpenResponsesRequestOrder, + OpenResponsesRequestOrderTypedDict, + OpenResponsesRequestPluginAutoRouter, + OpenResponsesRequestPluginAutoRouterTypedDict, OpenResponsesRequestPluginFileParser, OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginModeration, @@ -471,15 +497,14 @@ OpenResponsesRequestPluginWebTypedDict, OpenResponsesRequestProvider, OpenResponsesRequestProviderTypedDict, - OpenResponsesRequestRoute, + OpenResponsesRequestSort, + OpenResponsesRequestSortTypedDict, OpenResponsesRequestToolFunction, OpenResponsesRequestToolFunctionTypedDict, OpenResponsesRequestToolUnion, OpenResponsesRequestToolUnionTypedDict, OpenResponsesRequestType, OpenResponsesRequestTypedDict, - Order, - OrderTypedDict, ServiceTier, Truncation, ) @@ -613,13 +638,57 @@ PaymentRequiredResponseErrorData, PaymentRequiredResponseErrorDataTypedDict, ) + from .pdfparserengine import PDFParserEngine + from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict + from .percentilelatencycutoffs import ( + PercentileLatencyCutoffs, + PercentileLatencyCutoffsTypedDict, + ) + from .percentilestats import PercentileStats, PercentileStatsTypedDict + from .percentilethroughputcutoffs import ( + PercentileThroughputCutoffs, + PercentileThroughputCutoffsTypedDict, + ) from .perrequestlimits import PerRequestLimits, PerRequestLimitsTypedDict + from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict + from .preferredminthroughput import ( + PreferredMinThroughput, + PreferredMinThroughputTypedDict, + ) from .providername import ProviderName from .provideroverloadedresponseerrordata import ( ProviderOverloadedResponseErrorData, ProviderOverloadedResponseErrorDataTypedDict, ) + from .providerpreferences import ( + ProviderPreferences, + ProviderPreferencesIgnore, + ProviderPreferencesIgnoreTypedDict, + ProviderPreferencesMaxPrice, + ProviderPreferencesMaxPriceTypedDict, + ProviderPreferencesOnly, + ProviderPreferencesOnlyTypedDict, + ProviderPreferencesOrder, + ProviderPreferencesOrderTypedDict, + ProviderPreferencesPartition, + ProviderPreferencesProviderSort, + ProviderPreferencesProviderSortConfig, + ProviderPreferencesProviderSortConfigTypedDict, + ProviderPreferencesSortUnion, + ProviderPreferencesSortUnionTypedDict, + ProviderPreferencesTypedDict, + ProviderSortConfigEnum, + ProviderSortConfigUnion, + ProviderSortConfigUnionTypedDict, + SortEnum, + ) from .providersort import ProviderSort + from .providersortconfig import ( + Partition, + ProviderSortConfig, + ProviderSortConfigTypedDict, + ) + from .providersortunion import ProviderSortUnion, ProviderSortUnionTypedDict from .publicendpoint import ( Pricing, PricingTypedDict, @@ -728,6 +797,7 @@ ) from .responsesoutputitemreasoning import ( ResponsesOutputItemReasoning, + ResponsesOutputItemReasoningFormat, ResponsesOutputItemReasoningStatusCompleted, ResponsesOutputItemReasoningStatusInProgress, ResponsesOutputItemReasoningStatusIncomplete, @@ -749,6 +819,7 @@ ResponsesOutputMessageType, ResponsesOutputMessageTypedDict, ) + from .responsesoutputmodality import ResponsesOutputModality from .responsessearchcontextsize import ResponsesSearchContextSize from .responseswebsearchcalloutput import ( ResponsesWebSearchCallOutput, @@ -809,6 +880,7 @@ UserMessageContentTypedDict, UserMessageTypedDict, ) + from .websearchengine import WebSearchEngine from .websearchpreviewtooluserlocation import ( WebSearchPreviewToolUserLocation, WebSearchPreviewToolUserLocationType, @@ -835,12 +907,12 @@ "ChatErrorErrorTypedDict", "ChatGenerationParams", "ChatGenerationParamsDataCollection", - "ChatGenerationParamsEngine", + "ChatGenerationParamsImageConfig", + "ChatGenerationParamsImageConfigTypedDict", "ChatGenerationParamsMaxPrice", "ChatGenerationParamsMaxPriceTypedDict", - "ChatGenerationParamsPdf", - "ChatGenerationParamsPdfEngine", - "ChatGenerationParamsPdfTypedDict", + "ChatGenerationParamsPluginAutoRouter", + "ChatGenerationParamsPluginAutoRouterTypedDict", "ChatGenerationParamsPluginFileParser", "ChatGenerationParamsPluginFileParserTypedDict", "ChatGenerationParamsPluginModeration", @@ -851,6 +923,14 @@ "ChatGenerationParamsPluginUnionTypedDict", "ChatGenerationParamsPluginWeb", "ChatGenerationParamsPluginWebTypedDict", + "ChatGenerationParamsPreferredMaxLatency", + "ChatGenerationParamsPreferredMaxLatencyTypedDict", + "ChatGenerationParamsPreferredMaxLatencyUnion", + "ChatGenerationParamsPreferredMaxLatencyUnionTypedDict", + "ChatGenerationParamsPreferredMinThroughput", + "ChatGenerationParamsPreferredMinThroughputTypedDict", + "ChatGenerationParamsPreferredMinThroughputUnion", + "ChatGenerationParamsPreferredMinThroughputUnionTypedDict", "ChatGenerationParamsProvider", "ChatGenerationParamsProviderTypedDict", "ChatGenerationParamsResponseFormatJSONObject", @@ -861,7 +941,6 @@ "ChatGenerationParamsResponseFormatTextTypedDict", "ChatGenerationParamsResponseFormatUnion", "ChatGenerationParamsResponseFormatUnionTypedDict", - "ChatGenerationParamsRoute", "ChatGenerationParamsStop", "ChatGenerationParamsStopTypedDict", "ChatGenerationParamsTypedDict", @@ -954,6 +1033,7 @@ "EdgeNetworkTimeoutResponseErrorDataTypedDict", "Effort", "EndpointStatus", + "Engine", "FileCitation", "FileCitationType", "FileCitationTypedDict", @@ -962,12 +1042,11 @@ "FilePathTypedDict", "ForbiddenResponseErrorData", "ForbiddenResponseErrorDataTypedDict", + "IDAutoRouter", "IDFileParser", "IDModeration", "IDResponseHealing", "IDWeb", - "Ignore", - "IgnoreTypedDict", "ImageGenerationStatus", "ImageURL", "ImageURLTypedDict", @@ -987,6 +1066,7 @@ "MessageDeveloper", "MessageDeveloperTypedDict", "MessageTypedDict", + "Modality", "Model", "ModelArchitecture", "ModelArchitectureInstructType", @@ -1006,8 +1086,6 @@ "NotFoundResponseErrorData", "NotFoundResponseErrorDataTypedDict", "Object", - "Only", - "OnlyTypedDict", "OpenAIResponsesAnnotation", "OpenAIResponsesAnnotationTypedDict", "OpenAIResponsesIncludable", @@ -1153,12 +1231,18 @@ "OpenResponsesReasoningType", "OpenResponsesReasoningTypedDict", "OpenResponsesRequest", - "OpenResponsesRequestEngine", + "OpenResponsesRequestIgnore", + "OpenResponsesRequestIgnoreTypedDict", + "OpenResponsesRequestImageConfig", + "OpenResponsesRequestImageConfigTypedDict", "OpenResponsesRequestMaxPrice", "OpenResponsesRequestMaxPriceTypedDict", - "OpenResponsesRequestPdf", - "OpenResponsesRequestPdfEngine", - "OpenResponsesRequestPdfTypedDict", + "OpenResponsesRequestOnly", + "OpenResponsesRequestOnlyTypedDict", + "OpenResponsesRequestOrder", + "OpenResponsesRequestOrderTypedDict", + "OpenResponsesRequestPluginAutoRouter", + "OpenResponsesRequestPluginAutoRouterTypedDict", "OpenResponsesRequestPluginFileParser", "OpenResponsesRequestPluginFileParserTypedDict", "OpenResponsesRequestPluginModeration", @@ -1171,7 +1255,8 @@ "OpenResponsesRequestPluginWebTypedDict", "OpenResponsesRequestProvider", "OpenResponsesRequestProviderTypedDict", - "OpenResponsesRequestRoute", + "OpenResponsesRequestSort", + "OpenResponsesRequestSortTypedDict", "OpenResponsesRequestToolFunction", "OpenResponsesRequestToolFunctionTypedDict", "OpenResponsesRequestToolUnion", @@ -1237,8 +1322,6 @@ "OpenResponsesWebSearchToolFiltersTypedDict", "OpenResponsesWebSearchToolType", "OpenResponsesWebSearchToolTypedDict", - "Order", - "OrderTypedDict", "OutputItemImageGenerationCall", "OutputItemImageGenerationCallType", "OutputItemImageGenerationCallTypedDict", @@ -1256,17 +1339,34 @@ "OutputModality", "OutputTokensDetails", "OutputTokensDetailsTypedDict", + "PDFParserEngine", + "PDFParserOptions", + "PDFParserOptionsTypedDict", "Parameter", "Part1", "Part1TypedDict", "Part2", "Part2TypedDict", + "Partition", "PayloadTooLargeResponseErrorData", "PayloadTooLargeResponseErrorDataTypedDict", "PaymentRequiredResponseErrorData", "PaymentRequiredResponseErrorDataTypedDict", + "Pdf", + "PdfEngine", + "PdfTypedDict", "PerRequestLimits", "PerRequestLimitsTypedDict", + "PercentileLatencyCutoffs", + "PercentileLatencyCutoffsTypedDict", + "PercentileStats", + "PercentileStatsTypedDict", + "PercentileThroughputCutoffs", + "PercentileThroughputCutoffsTypedDict", + "PreferredMaxLatency", + "PreferredMaxLatencyTypedDict", + "PreferredMinThroughput", + "PreferredMinThroughputTypedDict", "Pricing", "PricingTypedDict", "Prompt", @@ -1276,7 +1376,30 @@ "ProviderName", "ProviderOverloadedResponseErrorData", "ProviderOverloadedResponseErrorDataTypedDict", + "ProviderPreferences", + "ProviderPreferencesIgnore", + "ProviderPreferencesIgnoreTypedDict", + "ProviderPreferencesMaxPrice", + "ProviderPreferencesMaxPriceTypedDict", + "ProviderPreferencesOnly", + "ProviderPreferencesOnlyTypedDict", + "ProviderPreferencesOrder", + "ProviderPreferencesOrderTypedDict", + "ProviderPreferencesPartition", + "ProviderPreferencesProviderSort", + "ProviderPreferencesProviderSortConfig", + "ProviderPreferencesProviderSortConfigTypedDict", + "ProviderPreferencesSortUnion", + "ProviderPreferencesSortUnionTypedDict", + "ProviderPreferencesTypedDict", "ProviderSort", + "ProviderSortConfig", + "ProviderSortConfigEnum", + "ProviderSortConfigTypedDict", + "ProviderSortConfigUnion", + "ProviderSortConfigUnionTypedDict", + "ProviderSortUnion", + "ProviderSortUnionTypedDict", "PublicEndpoint", "PublicEndpointQuantization", "PublicEndpointTypedDict", @@ -1351,6 +1474,7 @@ "ResponsesOutputItemFunctionCallType", "ResponsesOutputItemFunctionCallTypedDict", "ResponsesOutputItemReasoning", + "ResponsesOutputItemReasoningFormat", "ResponsesOutputItemReasoningStatusCompleted", "ResponsesOutputItemReasoningStatusInProgress", "ResponsesOutputItemReasoningStatusIncomplete", @@ -1370,6 +1494,7 @@ "ResponsesOutputMessageStatusUnionTypedDict", "ResponsesOutputMessageType", "ResponsesOutputMessageTypedDict", + "ResponsesOutputModality", "ResponsesSearchContextSize", "ResponsesWebSearchCallOutput", "ResponsesWebSearchCallOutputType", @@ -1377,15 +1502,25 @@ "ResponsesWebSearchUserLocation", "ResponsesWebSearchUserLocationType", "ResponsesWebSearchUserLocationTypedDict", + "Route", "Schema0", "Schema0Enum", "Schema0TypedDict", + "Schema3", + "Schema3ReasoningEncrypted", + "Schema3ReasoningEncryptedTypedDict", + "Schema3ReasoningSummary", + "Schema3ReasoningSummaryTypedDict", + "Schema3ReasoningText", + "Schema3ReasoningTextTypedDict", + "Schema3TypedDict", + "Schema5", "Security", "SecurityTypedDict", "ServiceTier", "ServiceUnavailableResponseErrorData", "ServiceUnavailableResponseErrorDataTypedDict", - "Sort", + "SortEnum", "StreamOptions", "StreamOptionsTypedDict", "SystemMessage", @@ -1446,6 +1581,7 @@ "VideoURL1TypedDict", "VideoURL2", "VideoURL2TypedDict", + "WebSearchEngine", "WebSearchPreviewToolUserLocation", "WebSearchPreviewToolUserLocationType", "WebSearchPreviewToolUserLocationTypedDict", @@ -1456,6 +1592,15 @@ "Schema0": "._schema0", "Schema0Enum": "._schema0", "Schema0TypedDict": "._schema0", + "Schema3": "._schema3", + "Schema3ReasoningEncrypted": "._schema3", + "Schema3ReasoningEncryptedTypedDict": "._schema3", + "Schema3ReasoningSummary": "._schema3", + "Schema3ReasoningSummaryTypedDict": "._schema3", + "Schema3ReasoningText": "._schema3", + "Schema3ReasoningTextTypedDict": "._schema3", + "Schema3TypedDict": "._schema3", + "Schema5": "._schema3", "ActivityItem": ".activityitem", "ActivityItemTypedDict": ".activityitem", "AssistantMessage": ".assistantmessage", @@ -1473,12 +1618,12 @@ "CodeTypedDict": ".chaterror", "ChatGenerationParams": ".chatgenerationparams", "ChatGenerationParamsDataCollection": ".chatgenerationparams", - "ChatGenerationParamsEngine": ".chatgenerationparams", + "ChatGenerationParamsImageConfig": ".chatgenerationparams", + "ChatGenerationParamsImageConfigTypedDict": ".chatgenerationparams", "ChatGenerationParamsMaxPrice": ".chatgenerationparams", "ChatGenerationParamsMaxPriceTypedDict": ".chatgenerationparams", - "ChatGenerationParamsPdf": ".chatgenerationparams", - "ChatGenerationParamsPdfEngine": ".chatgenerationparams", - "ChatGenerationParamsPdfTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPluginAutoRouter": ".chatgenerationparams", + "ChatGenerationParamsPluginAutoRouterTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginFileParser": ".chatgenerationparams", "ChatGenerationParamsPluginFileParserTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginModeration": ".chatgenerationparams", @@ -1489,6 +1634,14 @@ "ChatGenerationParamsPluginUnionTypedDict": ".chatgenerationparams", "ChatGenerationParamsPluginWeb": ".chatgenerationparams", "ChatGenerationParamsPluginWebTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPreferredMaxLatency": ".chatgenerationparams", + "ChatGenerationParamsPreferredMaxLatencyTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPreferredMaxLatencyUnion": ".chatgenerationparams", + "ChatGenerationParamsPreferredMaxLatencyUnionTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPreferredMinThroughput": ".chatgenerationparams", + "ChatGenerationParamsPreferredMinThroughputTypedDict": ".chatgenerationparams", + "ChatGenerationParamsPreferredMinThroughputUnion": ".chatgenerationparams", + "ChatGenerationParamsPreferredMinThroughputUnionTypedDict": ".chatgenerationparams", "ChatGenerationParamsProvider": ".chatgenerationparams", "ChatGenerationParamsProviderTypedDict": ".chatgenerationparams", "ChatGenerationParamsResponseFormatJSONObject": ".chatgenerationparams", @@ -1499,17 +1652,21 @@ "ChatGenerationParamsResponseFormatTextTypedDict": ".chatgenerationparams", "ChatGenerationParamsResponseFormatUnion": ".chatgenerationparams", "ChatGenerationParamsResponseFormatUnionTypedDict": ".chatgenerationparams", - "ChatGenerationParamsRoute": ".chatgenerationparams", "ChatGenerationParamsStop": ".chatgenerationparams", "ChatGenerationParamsStopTypedDict": ".chatgenerationparams", "ChatGenerationParamsTypedDict": ".chatgenerationparams", "Debug": ".chatgenerationparams", "DebugTypedDict": ".chatgenerationparams", "Effort": ".chatgenerationparams", + "Engine": ".chatgenerationparams", + "Modality": ".chatgenerationparams", + "Pdf": ".chatgenerationparams", + "PdfEngine": ".chatgenerationparams", + "PdfTypedDict": ".chatgenerationparams", "Quantizations": ".chatgenerationparams", "Reasoning": ".chatgenerationparams", "ReasoningTypedDict": ".chatgenerationparams", - "Sort": ".chatgenerationparams", + "Route": ".chatgenerationparams", "ChatGenerationTokenUsage": ".chatgenerationtokenusage", "ChatGenerationTokenUsageTypedDict": ".chatgenerationtokenusage", "CompletionTokensDetails": ".chatgenerationtokenusage", @@ -1801,21 +1958,24 @@ "OpenResponsesReasoningSummaryTextDoneEvent": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEventType": ".openresponsesreasoningsummarytextdoneevent", "OpenResponsesReasoningSummaryTextDoneEventTypedDict": ".openresponsesreasoningsummarytextdoneevent", + "IDAutoRouter": ".openresponsesrequest", "IDFileParser": ".openresponsesrequest", "IDModeration": ".openresponsesrequest", "IDResponseHealing": ".openresponsesrequest", "IDWeb": ".openresponsesrequest", - "Ignore": ".openresponsesrequest", - "IgnoreTypedDict": ".openresponsesrequest", - "Only": ".openresponsesrequest", - "OnlyTypedDict": ".openresponsesrequest", "OpenResponsesRequest": ".openresponsesrequest", - "OpenResponsesRequestEngine": ".openresponsesrequest", + "OpenResponsesRequestIgnore": ".openresponsesrequest", + "OpenResponsesRequestIgnoreTypedDict": ".openresponsesrequest", + "OpenResponsesRequestImageConfig": ".openresponsesrequest", + "OpenResponsesRequestImageConfigTypedDict": ".openresponsesrequest", "OpenResponsesRequestMaxPrice": ".openresponsesrequest", "OpenResponsesRequestMaxPriceTypedDict": ".openresponsesrequest", - "OpenResponsesRequestPdf": ".openresponsesrequest", - "OpenResponsesRequestPdfEngine": ".openresponsesrequest", - "OpenResponsesRequestPdfTypedDict": ".openresponsesrequest", + "OpenResponsesRequestOnly": ".openresponsesrequest", + "OpenResponsesRequestOnlyTypedDict": ".openresponsesrequest", + "OpenResponsesRequestOrder": ".openresponsesrequest", + "OpenResponsesRequestOrderTypedDict": ".openresponsesrequest", + "OpenResponsesRequestPluginAutoRouter": ".openresponsesrequest", + "OpenResponsesRequestPluginAutoRouterTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginFileParser": ".openresponsesrequest", "OpenResponsesRequestPluginFileParserTypedDict": ".openresponsesrequest", "OpenResponsesRequestPluginModeration": ".openresponsesrequest", @@ -1828,15 +1988,14 @@ "OpenResponsesRequestPluginWebTypedDict": ".openresponsesrequest", "OpenResponsesRequestProvider": ".openresponsesrequest", "OpenResponsesRequestProviderTypedDict": ".openresponsesrequest", - "OpenResponsesRequestRoute": ".openresponsesrequest", + "OpenResponsesRequestSort": ".openresponsesrequest", + "OpenResponsesRequestSortTypedDict": ".openresponsesrequest", "OpenResponsesRequestToolFunction": ".openresponsesrequest", "OpenResponsesRequestToolFunctionTypedDict": ".openresponsesrequest", "OpenResponsesRequestToolUnion": ".openresponsesrequest", "OpenResponsesRequestToolUnionTypedDict": ".openresponsesrequest", "OpenResponsesRequestType": ".openresponsesrequest", "OpenResponsesRequestTypedDict": ".openresponsesrequest", - "Order": ".openresponsesrequest", - "OrderTypedDict": ".openresponsesrequest", "ServiceTier": ".openresponsesrequest", "Truncation": ".openresponsesrequest", "OpenResponsesResponseText": ".openresponsesresponsetext", @@ -1945,12 +2104,50 @@ "PayloadTooLargeResponseErrorDataTypedDict": ".payloadtoolargeresponseerrordata", "PaymentRequiredResponseErrorData": ".paymentrequiredresponseerrordata", "PaymentRequiredResponseErrorDataTypedDict": ".paymentrequiredresponseerrordata", + "PDFParserEngine": ".pdfparserengine", + "PDFParserOptions": ".pdfparseroptions", + "PDFParserOptionsTypedDict": ".pdfparseroptions", + "PercentileLatencyCutoffs": ".percentilelatencycutoffs", + "PercentileLatencyCutoffsTypedDict": ".percentilelatencycutoffs", + "PercentileStats": ".percentilestats", + "PercentileStatsTypedDict": ".percentilestats", + "PercentileThroughputCutoffs": ".percentilethroughputcutoffs", + "PercentileThroughputCutoffsTypedDict": ".percentilethroughputcutoffs", "PerRequestLimits": ".perrequestlimits", "PerRequestLimitsTypedDict": ".perrequestlimits", + "PreferredMaxLatency": ".preferredmaxlatency", + "PreferredMaxLatencyTypedDict": ".preferredmaxlatency", + "PreferredMinThroughput": ".preferredminthroughput", + "PreferredMinThroughputTypedDict": ".preferredminthroughput", "ProviderName": ".providername", "ProviderOverloadedResponseErrorData": ".provideroverloadedresponseerrordata", "ProviderOverloadedResponseErrorDataTypedDict": ".provideroverloadedresponseerrordata", + "ProviderPreferences": ".providerpreferences", + "ProviderPreferencesIgnore": ".providerpreferences", + "ProviderPreferencesIgnoreTypedDict": ".providerpreferences", + "ProviderPreferencesMaxPrice": ".providerpreferences", + "ProviderPreferencesMaxPriceTypedDict": ".providerpreferences", + "ProviderPreferencesOnly": ".providerpreferences", + "ProviderPreferencesOnlyTypedDict": ".providerpreferences", + "ProviderPreferencesOrder": ".providerpreferences", + "ProviderPreferencesOrderTypedDict": ".providerpreferences", + "ProviderPreferencesPartition": ".providerpreferences", + "ProviderPreferencesProviderSort": ".providerpreferences", + "ProviderPreferencesProviderSortConfig": ".providerpreferences", + "ProviderPreferencesProviderSortConfigTypedDict": ".providerpreferences", + "ProviderPreferencesSortUnion": ".providerpreferences", + "ProviderPreferencesSortUnionTypedDict": ".providerpreferences", + "ProviderPreferencesTypedDict": ".providerpreferences", + "ProviderSortConfigEnum": ".providerpreferences", + "ProviderSortConfigUnion": ".providerpreferences", + "ProviderSortConfigUnionTypedDict": ".providerpreferences", + "SortEnum": ".providerpreferences", "ProviderSort": ".providersort", + "Partition": ".providersortconfig", + "ProviderSortConfig": ".providersortconfig", + "ProviderSortConfigTypedDict": ".providersortconfig", + "ProviderSortUnion": ".providersortunion", + "ProviderSortUnionTypedDict": ".providersortunion", "Pricing": ".publicendpoint", "PricingTypedDict": ".publicendpoint", "PublicEndpoint": ".publicendpoint", @@ -2022,6 +2219,7 @@ "ResponsesOutputItemFunctionCallType": ".responsesoutputitemfunctioncall", "ResponsesOutputItemFunctionCallTypedDict": ".responsesoutputitemfunctioncall", "ResponsesOutputItemReasoning": ".responsesoutputitemreasoning", + "ResponsesOutputItemReasoningFormat": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusCompleted": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusInProgress": ".responsesoutputitemreasoning", "ResponsesOutputItemReasoningStatusIncomplete": ".responsesoutputitemreasoning", @@ -2040,6 +2238,7 @@ "ResponsesOutputMessageStatusUnionTypedDict": ".responsesoutputmessage", "ResponsesOutputMessageType": ".responsesoutputmessage", "ResponsesOutputMessageTypedDict": ".responsesoutputmessage", + "ResponsesOutputModality": ".responsesoutputmodality", "ResponsesSearchContextSize": ".responsessearchcontextsize", "ResponsesWebSearchCallOutput": ".responseswebsearchcalloutput", "ResponsesWebSearchCallOutputType": ".responseswebsearchcalloutput", @@ -2082,6 +2281,7 @@ "UserMessageContent": ".usermessage", "UserMessageContentTypedDict": ".usermessage", "UserMessageTypedDict": ".usermessage", + "WebSearchEngine": ".websearchengine", "WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation", diff --git a/src/openrouter/components/_schema0.py b/src/openrouter/components/_schema0.py index 0cf0caf..fdc167b 100644 --- a/src/openrouter/components/_schema0.py +++ b/src/openrouter/components/_schema0.py @@ -36,7 +36,6 @@ "Fireworks", "Friendli", "GMICloud", - "GoPomelo", "Google", "Google AI Studio", "Groq", @@ -66,13 +65,14 @@ "Phala", "Relace", "SambaNova", + "Seed", "SiliconFlow", "Sourceful", "Stealth", "StreamLake", "Switchpoint", - "Targon", "Together", + "Upstage", "Venice", "WandB", "Xiaomi", diff --git a/src/openrouter/components/_schema3.py b/src/openrouter/components/_schema3.py new file mode 100644 index 0000000..84a7df8 --- /dev/null +++ b/src/openrouter/components/_schema3.py @@ -0,0 +1,229 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import get_discriminator, validate_const, validate_open_enum +import pydantic +from pydantic import Discriminator, Tag, model_serializer +from pydantic.functional_validators import AfterValidator, PlainValidator +from typing import Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +Schema5 = Union[ + Literal[ + "unknown", + "openai-responses-v1", + "azure-openai-responses-v1", + "xai-responses-v1", + "anthropic-claude-v1", + "google-gemini-v1", + ], + UnrecognizedStr, +] + + +class Schema3ReasoningTextTypedDict(TypedDict): + type: Literal["reasoning.text"] + text: NotRequired[Nullable[str]] + signature: NotRequired[Nullable[str]] + id: NotRequired[Nullable[str]] + format_: NotRequired[Nullable[Schema5]] + index: NotRequired[float] + + +class Schema3ReasoningText(BaseModel): + TYPE: Annotated[ + Annotated[ + Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text")) + ], + pydantic.Field(alias="type"), + ] = "reasoning.text" + + text: OptionalNullable[str] = UNSET + + signature: OptionalNullable[str] = UNSET + + id: OptionalNullable[str] = UNSET + + format_: Annotated[ + Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + pydantic.Field(alias="format"), + ] = UNSET + + index: Optional[float] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["text", "signature", "id", "format", "index"] + nullable_fields = ["text", "signature", "id", "format"] + 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 Schema3ReasoningEncryptedTypedDict(TypedDict): + data: str + type: Literal["reasoning.encrypted"] + id: NotRequired[Nullable[str]] + format_: NotRequired[Nullable[Schema5]] + index: NotRequired[float] + + +class Schema3ReasoningEncrypted(BaseModel): + data: str + + TYPE: Annotated[ + Annotated[ + Literal["reasoning.encrypted"], + AfterValidator(validate_const("reasoning.encrypted")), + ], + pydantic.Field(alias="type"), + ] = "reasoning.encrypted" + + id: OptionalNullable[str] = UNSET + + format_: Annotated[ + Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + pydantic.Field(alias="format"), + ] = UNSET + + index: Optional[float] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "format", "index"] + nullable_fields = ["id", "format"] + 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 Schema3ReasoningSummaryTypedDict(TypedDict): + summary: str + type: Literal["reasoning.summary"] + id: NotRequired[Nullable[str]] + format_: NotRequired[Nullable[Schema5]] + index: NotRequired[float] + + +class Schema3ReasoningSummary(BaseModel): + summary: str + + TYPE: Annotated[ + Annotated[ + Literal["reasoning.summary"], + AfterValidator(validate_const("reasoning.summary")), + ], + pydantic.Field(alias="type"), + ] = "reasoning.summary" + + id: OptionalNullable[str] = UNSET + + format_: Annotated[ + Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + pydantic.Field(alias="format"), + ] = UNSET + + index: Optional[float] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "format", "index"] + nullable_fields = ["id", "format"] + 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 + + +Schema3TypedDict = TypeAliasType( + "Schema3TypedDict", + Union[ + Schema3ReasoningSummaryTypedDict, + Schema3ReasoningEncryptedTypedDict, + Schema3ReasoningTextTypedDict, + ], +) + + +Schema3 = Annotated[ + Union[ + Annotated[Schema3ReasoningSummary, Tag("reasoning.summary")], + Annotated[Schema3ReasoningEncrypted, Tag("reasoning.encrypted")], + Annotated[Schema3ReasoningText, Tag("reasoning.text")], + ], + Discriminator(lambda m: get_discriminator(m, "type", "type")), +] diff --git a/src/openrouter/components/chatgenerationparams.py b/src/openrouter/components/chatgenerationparams.py index c0d4a56..226d298 100644 --- a/src/openrouter/components/chatgenerationparams.py +++ b/src/openrouter/components/chatgenerationparams.py @@ -4,6 +4,7 @@ from ._schema0 import Schema0, Schema0TypedDict from .chatstreamoptions import ChatStreamOptions, ChatStreamOptionsTypedDict from .message import Message, MessageTypedDict +from .providersortunion import ProviderSortUnion, ProviderSortUnionTypedDict from .reasoningsummaryverbosity import ReasoningSummaryVerbosity from .responseformatjsonschema import ( ResponseFormatJSONSchema, @@ -55,16 +56,6 @@ ] -Sort = Union[ - Literal[ - "price", - "throughput", - "latency", - ], - UnrecognizedStr, -] - - class ChatGenerationParamsMaxPriceTypedDict(TypedDict): r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" @@ -89,6 +80,124 @@ class ChatGenerationParamsMaxPrice(BaseModel): request: Optional[Any] = None +class ChatGenerationParamsPreferredMinThroughputTypedDict(TypedDict): + p50: NotRequired[Nullable[float]] + p75: NotRequired[Nullable[float]] + p90: NotRequired[Nullable[float]] + p99: NotRequired[Nullable[float]] + + +class ChatGenerationParamsPreferredMinThroughput(BaseModel): + p50: OptionalNullable[float] = UNSET + + p75: OptionalNullable[float] = UNSET + + p90: OptionalNullable[float] = UNSET + + p99: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["p50", "p75", "p90", "p99"] + nullable_fields = ["p50", "p75", "p90", "p99"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +ChatGenerationParamsPreferredMinThroughputUnionTypedDict = TypeAliasType( + "ChatGenerationParamsPreferredMinThroughputUnionTypedDict", + Union[ChatGenerationParamsPreferredMinThroughputTypedDict, float], +) + + +ChatGenerationParamsPreferredMinThroughputUnion = TypeAliasType( + "ChatGenerationParamsPreferredMinThroughputUnion", + Union[ChatGenerationParamsPreferredMinThroughput, float], +) + + +class ChatGenerationParamsPreferredMaxLatencyTypedDict(TypedDict): + p50: NotRequired[Nullable[float]] + p75: NotRequired[Nullable[float]] + p90: NotRequired[Nullable[float]] + p99: NotRequired[Nullable[float]] + + +class ChatGenerationParamsPreferredMaxLatency(BaseModel): + p50: OptionalNullable[float] = UNSET + + p75: OptionalNullable[float] = UNSET + + p90: OptionalNullable[float] = UNSET + + p99: OptionalNullable[float] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["p50", "p75", "p90", "p99"] + nullable_fields = ["p50", "p75", "p90", "p99"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +ChatGenerationParamsPreferredMaxLatencyUnionTypedDict = TypeAliasType( + "ChatGenerationParamsPreferredMaxLatencyUnionTypedDict", + Union[ChatGenerationParamsPreferredMaxLatencyTypedDict, float], +) + + +ChatGenerationParamsPreferredMaxLatencyUnion = TypeAliasType( + "ChatGenerationParamsPreferredMaxLatencyUnion", + Union[ChatGenerationParamsPreferredMaxLatency, float], +) + + class ChatGenerationParamsProviderTypedDict(TypedDict): allow_fallbacks: NotRequired[Nullable[bool]] r"""Whether to allow backup providers to serve requests @@ -114,14 +223,18 @@ class ChatGenerationParamsProviderTypedDict(TypedDict): r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" quantizations: NotRequired[Nullable[List[Quantizations]]] r"""A list of quantization levels to filter the provider by.""" - sort: NotRequired[Nullable[Sort]] + sort: NotRequired[Nullable[ProviderSortUnionTypedDict]] r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" max_price: NotRequired[ChatGenerationParamsMaxPriceTypedDict] r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - min_throughput: NotRequired[Nullable[float]] - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" - max_latency: NotRequired[Nullable[float]] - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" + preferred_min_throughput: NotRequired[ + Nullable[ChatGenerationParamsPreferredMinThroughputUnionTypedDict] + ] + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + preferred_max_latency: NotRequired[ + Nullable[ChatGenerationParamsPreferredMaxLatencyUnionTypedDict] + ] + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" class ChatGenerationParamsProvider(BaseModel): @@ -163,19 +276,21 @@ class ChatGenerationParamsProvider(BaseModel): ] = UNSET r"""A list of quantization levels to filter the provider by.""" - sort: Annotated[ - OptionalNullable[Sort], PlainValidator(validate_open_enum(False)) - ] = UNSET + sort: OptionalNullable[ProviderSortUnion] = UNSET r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" max_price: Optional[ChatGenerationParamsMaxPrice] = None r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - min_throughput: OptionalNullable[float] = UNSET - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" + preferred_min_throughput: OptionalNullable[ + ChatGenerationParamsPreferredMinThroughputUnion + ] = UNSET + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" - max_latency: OptionalNullable[float] = UNSET - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" + preferred_max_latency: OptionalNullable[ + ChatGenerationParamsPreferredMaxLatencyUnion + ] = UNSET + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -191,8 +306,8 @@ def serialize_model(self, handler): "quantizations", "sort", "max_price", - "min_throughput", - "max_latency", + "preferred_min_throughput", + "preferred_max_latency", ] nullable_fields = [ "allow_fallbacks", @@ -205,8 +320,8 @@ def serialize_model(self, handler): "ignore", "quantizations", "sort", - "min_throughput", - "max_latency", + "preferred_min_throughput", + "preferred_max_latency", ] null_default_fields = [] @@ -252,7 +367,7 @@ class ChatGenerationParamsPluginResponseHealing(BaseModel): enabled: Optional[bool] = None -ChatGenerationParamsPdfEngine = Union[ +PdfEngine = Union[ Literal[ "mistral-ocr", "pdf-text", @@ -262,21 +377,20 @@ class ChatGenerationParamsPluginResponseHealing(BaseModel): ] -class ChatGenerationParamsPdfTypedDict(TypedDict): - engine: NotRequired[ChatGenerationParamsPdfEngine] +class PdfTypedDict(TypedDict): + engine: NotRequired[PdfEngine] -class ChatGenerationParamsPdf(BaseModel): +class Pdf(BaseModel): engine: Annotated[ - Optional[ChatGenerationParamsPdfEngine], - PlainValidator(validate_open_enum(False)), + Optional[PdfEngine], PlainValidator(validate_open_enum(False)) ] = None class ChatGenerationParamsPluginFileParserTypedDict(TypedDict): id: Literal["file-parser"] enabled: NotRequired[bool] - pdf: NotRequired[ChatGenerationParamsPdfTypedDict] + pdf: NotRequired[PdfTypedDict] class ChatGenerationParamsPluginFileParser(BaseModel): @@ -289,10 +403,10 @@ class ChatGenerationParamsPluginFileParser(BaseModel): enabled: Optional[bool] = None - pdf: Optional[ChatGenerationParamsPdf] = None + pdf: Optional[Pdf] = None -ChatGenerationParamsEngine = Union[ +Engine = Union[ Literal[ "native", "exa", @@ -306,7 +420,7 @@ class ChatGenerationParamsPluginWebTypedDict(TypedDict): enabled: NotRequired[bool] max_results: NotRequired[float] search_prompt: NotRequired[str] - engine: NotRequired[ChatGenerationParamsEngine] + engine: NotRequired[Engine] class ChatGenerationParamsPluginWeb(BaseModel): @@ -321,9 +435,9 @@ class ChatGenerationParamsPluginWeb(BaseModel): search_prompt: Optional[str] = None - engine: Annotated[ - Optional[ChatGenerationParamsEngine], PlainValidator(validate_open_enum(False)) - ] = None + engine: Annotated[Optional[Engine], PlainValidator(validate_open_enum(False))] = ( + None + ) class ChatGenerationParamsPluginModerationTypedDict(TypedDict): @@ -337,11 +451,31 @@ class ChatGenerationParamsPluginModeration(BaseModel): ] = "moderation" +class ChatGenerationParamsPluginAutoRouterTypedDict(TypedDict): + id: Literal["auto-router"] + enabled: NotRequired[bool] + allowed_models: NotRequired[List[str]] + + +class ChatGenerationParamsPluginAutoRouter(BaseModel): + ID: Annotated[ + Annotated[ + Literal["auto-router"], AfterValidator(validate_const("auto-router")) + ], + pydantic.Field(alias="id"), + ] = "auto-router" + + enabled: Optional[bool] = None + + allowed_models: Optional[List[str]] = None + + ChatGenerationParamsPluginUnionTypedDict = TypeAliasType( "ChatGenerationParamsPluginUnionTypedDict", Union[ ChatGenerationParamsPluginModerationTypedDict, ChatGenerationParamsPluginResponseHealingTypedDict, + ChatGenerationParamsPluginAutoRouterTypedDict, ChatGenerationParamsPluginFileParserTypedDict, ChatGenerationParamsPluginWebTypedDict, ], @@ -350,6 +484,7 @@ class ChatGenerationParamsPluginModeration(BaseModel): ChatGenerationParamsPluginUnion = Annotated[ Union[ + Annotated[ChatGenerationParamsPluginAutoRouter, Tag("auto-router")], Annotated[ChatGenerationParamsPluginModeration, Tag("moderation")], Annotated[ChatGenerationParamsPluginWeb, Tag("web")], Annotated[ChatGenerationParamsPluginFileParser, Tag("file-parser")], @@ -359,7 +494,7 @@ class ChatGenerationParamsPluginModeration(BaseModel): ] -ChatGenerationParamsRoute = Union[ +Route = Union[ Literal[ "fallback", "sort", @@ -370,12 +505,12 @@ class ChatGenerationParamsPluginModeration(BaseModel): Effort = Union[ Literal[ - "none", - "minimal", - "low", - "medium", - "high", "xhigh", + "high", + "medium", + "low", + "minimal", + "none", ], UnrecognizedStr, ] @@ -504,14 +639,32 @@ class Debug(BaseModel): echo_upstream_body: Optional[bool] = None +ChatGenerationParamsImageConfigTypedDict = TypeAliasType( + "ChatGenerationParamsImageConfigTypedDict", Union[str, float] +) + + +ChatGenerationParamsImageConfig = TypeAliasType( + "ChatGenerationParamsImageConfig", Union[str, float] +) + + +Modality = Union[ + Literal[ + "text", + "image", + ], + UnrecognizedStr, +] + + class ChatGenerationParamsTypedDict(TypedDict): messages: List[MessageTypedDict] provider: NotRequired[Nullable[ChatGenerationParamsProviderTypedDict]] r"""When multiple model providers are available, optionally indicate your routing preference.""" plugins: NotRequired[List[ChatGenerationParamsPluginUnionTypedDict]] r"""Plugins you want to enable for this request, including their settings.""" - route: NotRequired[Nullable[ChatGenerationParamsRoute]] - r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.""" + route: NotRequired[Nullable[Route]] user: NotRequired[str] session_id: NotRequired[str] r"""A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters.""" @@ -536,6 +689,8 @@ class ChatGenerationParamsTypedDict(TypedDict): tools: NotRequired[List[ToolDefinitionJSONTypedDict]] top_p: NotRequired[Nullable[float]] debug: NotRequired[DebugTypedDict] + image_config: NotRequired[Dict[str, ChatGenerationParamsImageConfigTypedDict]] + modalities: NotRequired[List[Modality]] class ChatGenerationParams(BaseModel): @@ -548,10 +703,8 @@ class ChatGenerationParams(BaseModel): r"""Plugins you want to enable for this request, including their settings.""" route: Annotated[ - OptionalNullable[ChatGenerationParamsRoute], - PlainValidator(validate_open_enum(False)), + OptionalNullable[Route], PlainValidator(validate_open_enum(False)) ] = UNSET - r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.""" user: Optional[str] = None @@ -600,6 +753,12 @@ class ChatGenerationParams(BaseModel): debug: Optional[Debug] = None + image_config: Optional[Dict[str, ChatGenerationParamsImageConfig]] = None + + modalities: Optional[ + List[Annotated[Modality, PlainValidator(validate_open_enum(False))]] + ] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -629,6 +788,8 @@ def serialize_model(self, handler): "tools", "top_p", "debug", + "image_config", + "modalities", ] nullable_fields = [ "provider", diff --git a/src/openrouter/components/chatgenerationtokenusage.py b/src/openrouter/components/chatgenerationtokenusage.py index e8aa115..6079682 100644 --- a/src/openrouter/components/chatgenerationtokenusage.py +++ b/src/openrouter/components/chatgenerationtokenusage.py @@ -72,6 +72,7 @@ def serialize_model(self, handler): class PromptTokensDetailsTypedDict(TypedDict): cached_tokens: NotRequired[float] + cache_write_tokens: NotRequired[float] audio_tokens: NotRequired[float] video_tokens: NotRequired[float] @@ -79,6 +80,8 @@ class PromptTokensDetailsTypedDict(TypedDict): class PromptTokensDetails(BaseModel): cached_tokens: Optional[float] = None + cache_write_tokens: Optional[float] = None + audio_tokens: Optional[float] = None video_tokens: Optional[float] = None diff --git a/src/openrouter/components/chatresponsechoice.py b/src/openrouter/components/chatresponsechoice.py index 9592bf1..9696904 100644 --- a/src/openrouter/components/chatresponsechoice.py +++ b/src/openrouter/components/chatresponsechoice.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from ._schema3 import Schema3, Schema3TypedDict from .assistantmessage import AssistantMessage, AssistantMessageTypedDict from .chatcompletionfinishreason import ChatCompletionFinishReason from .chatmessagetokenlogprobs import ( @@ -17,6 +18,7 @@ from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator +from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -24,6 +26,7 @@ class ChatResponseChoiceTypedDict(TypedDict): finish_reason: Nullable[ChatCompletionFinishReason] index: float message: AssistantMessageTypedDict + reasoning_details: NotRequired[List[Schema3TypedDict]] logprobs: NotRequired[Nullable[ChatMessageTokenLogprobsTypedDict]] @@ -36,11 +39,13 @@ class ChatResponseChoice(BaseModel): message: AssistantMessage + reasoning_details: Optional[List[Schema3]] = None + logprobs: OptionalNullable[ChatMessageTokenLogprobs] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["logprobs"] + optional_fields = ["reasoning_details", "logprobs"] nullable_fields = ["finish_reason", "logprobs"] null_default_fields = [] diff --git a/src/openrouter/components/chatstreamingmessagechunk.py b/src/openrouter/components/chatstreamingmessagechunk.py index dec4faf..8852ee8 100644 --- a/src/openrouter/components/chatstreamingmessagechunk.py +++ b/src/openrouter/components/chatstreamingmessagechunk.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from ._schema3 import Schema3, Schema3TypedDict from .chatstreamingmessagetoolcall import ( ChatStreamingMessageToolCall, ChatStreamingMessageToolCallTypedDict, @@ -26,6 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict): reasoning: NotRequired[Nullable[str]] refusal: NotRequired[Nullable[str]] tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]] + reasoning_details: NotRequired[List[Schema3TypedDict]] class ChatStreamingMessageChunk(BaseModel): @@ -39,9 +41,18 @@ class ChatStreamingMessageChunk(BaseModel): tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None + reasoning_details: Optional[List[Schema3]] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["role", "content", "reasoning", "refusal", "tool_calls"] + optional_fields = [ + "role", + "content", + "reasoning", + "refusal", + "tool_calls", + "reasoning_details", + ] nullable_fields = ["content", "reasoning", "refusal"] null_default_fields = [] diff --git a/src/openrouter/components/openresponsesinput.py b/src/openrouter/components/openresponsesinput.py index af37abe..e40fe56 100644 --- a/src/openrouter/components/openresponsesinput.py +++ b/src/openrouter/components/openresponsesinput.py @@ -60,9 +60,9 @@ OpenResponsesFunctionCallOutputTypedDict, ResponsesOutputMessageTypedDict, OpenResponsesFunctionToolCallTypedDict, - ResponsesOutputItemReasoningTypedDict, ResponsesOutputItemFunctionCallTypedDict, OpenResponsesReasoningTypedDict, + ResponsesOutputItemReasoningTypedDict, ], ) @@ -78,9 +78,9 @@ OpenResponsesFunctionCallOutput, ResponsesOutputMessage, OpenResponsesFunctionToolCall, - ResponsesOutputItemReasoning, ResponsesOutputItemFunctionCall, OpenResponsesReasoning, + ResponsesOutputItemReasoning, ], ) diff --git a/src/openrouter/components/openresponsesreasoning.py b/src/openrouter/components/openresponsesreasoning.py index 1237605..af1dda6 100644 --- a/src/openrouter/components/openresponsesreasoning.py +++ b/src/openrouter/components/openresponsesreasoning.py @@ -55,6 +55,7 @@ Literal[ "unknown", "openai-responses-v1", + "azure-openai-responses-v1", "xai-responses-v1", "anthropic-claude-v1", "google-gemini-v1", diff --git a/src/openrouter/components/openresponsesrequest.py b/src/openrouter/components/openresponsesrequest.py index 6053832..c422085 100644 --- a/src/openrouter/components/openresponsesrequest.py +++ b/src/openrouter/components/openresponsesrequest.py @@ -33,9 +33,18 @@ OpenResponsesWebSearchTool, OpenResponsesWebSearchToolTypedDict, ) +from .pdfparseroptions import PDFParserOptions, PDFParserOptionsTypedDict +from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict +from .preferredminthroughput import ( + PreferredMinThroughput, + PreferredMinThroughputTypedDict, +) from .providername import ProviderName from .providersort import ProviderSort +from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict from .quantization import Quantization +from .responsesoutputmodality import ResponsesOutputModality +from .websearchengine import WebSearchEngine from openrouter.types import ( BaseModel, Nullable, @@ -136,6 +145,16 @@ def serialize_model(self, handler): ] +OpenResponsesRequestImageConfigTypedDict = TypeAliasType( + "OpenResponsesRequestImageConfigTypedDict", Union[str, float] +) + + +OpenResponsesRequestImageConfig = TypeAliasType( + "OpenResponsesRequestImageConfig", Union[str, float] +) + + ServiceTier = Literal["auto",] @@ -148,33 +167,57 @@ def serialize_model(self, handler): ] -OrderTypedDict = TypeAliasType("OrderTypedDict", Union[ProviderName, str]) +OpenResponsesRequestOrderTypedDict = TypeAliasType( + "OpenResponsesRequestOrderTypedDict", Union[ProviderName, str] +) -Order = TypeAliasType( - "Order", +OpenResponsesRequestOrder = TypeAliasType( + "OpenResponsesRequestOrder", Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], ) -OnlyTypedDict = TypeAliasType("OnlyTypedDict", Union[ProviderName, str]) +OpenResponsesRequestOnlyTypedDict = TypeAliasType( + "OpenResponsesRequestOnlyTypedDict", Union[ProviderName, str] +) -Only = TypeAliasType( - "Only", +OpenResponsesRequestOnly = TypeAliasType( + "OpenResponsesRequestOnly", Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], ) -IgnoreTypedDict = TypeAliasType("IgnoreTypedDict", Union[ProviderName, str]) +OpenResponsesRequestIgnoreTypedDict = TypeAliasType( + "OpenResponsesRequestIgnoreTypedDict", Union[ProviderName, str] +) -Ignore = TypeAliasType( - "Ignore", +OpenResponsesRequestIgnore = TypeAliasType( + "OpenResponsesRequestIgnore", Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], ) +OpenResponsesRequestSortTypedDict = TypeAliasType( + "OpenResponsesRequestSortTypedDict", + Union[ProviderSortConfigTypedDict, ProviderSort, Any], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +OpenResponsesRequestSort = TypeAliasType( + "OpenResponsesRequestSort", + Union[ + ProviderSortConfig, + Annotated[ProviderSort, PlainValidator(validate_open_enum(False))], + Any, + ], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + class OpenResponsesRequestMaxPriceTypedDict(TypedDict): r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" @@ -230,22 +273,22 @@ class OpenResponsesRequestProviderTypedDict(TypedDict): r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" enforce_distillable_text: NotRequired[Nullable[bool]] r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - order: NotRequired[Nullable[List[OrderTypedDict]]] + order: NotRequired[Nullable[List[OpenResponsesRequestOrderTypedDict]]] r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" - only: NotRequired[Nullable[List[OnlyTypedDict]]] + only: NotRequired[Nullable[List[OpenResponsesRequestOnlyTypedDict]]] r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - ignore: NotRequired[Nullable[List[IgnoreTypedDict]]] + ignore: NotRequired[Nullable[List[OpenResponsesRequestIgnoreTypedDict]]] r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" quantizations: NotRequired[Nullable[List[Quantization]]] r"""A list of quantization levels to filter the provider by.""" - sort: NotRequired[Nullable[ProviderSort]] + sort: NotRequired[Nullable[OpenResponsesRequestSortTypedDict]] r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" max_price: NotRequired[OpenResponsesRequestMaxPriceTypedDict] r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - min_throughput: NotRequired[Nullable[float]] - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" - max_latency: NotRequired[Nullable[float]] - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" + preferred_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]] + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]] + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" class OpenResponsesRequestProvider(BaseModel): @@ -276,13 +319,13 @@ class OpenResponsesRequestProvider(BaseModel): enforce_distillable_text: OptionalNullable[bool] = UNSET r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - order: OptionalNullable[List[Order]] = UNSET + order: OptionalNullable[List[OpenResponsesRequestOrder]] = UNSET r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" - only: OptionalNullable[List[Only]] = UNSET + only: OptionalNullable[List[OpenResponsesRequestOnly]] = UNSET r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - ignore: OptionalNullable[List[Ignore]] = UNSET + ignore: OptionalNullable[List[OpenResponsesRequestIgnore]] = UNSET r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" quantizations: OptionalNullable[ @@ -290,19 +333,17 @@ class OpenResponsesRequestProvider(BaseModel): ] = UNSET r"""A list of quantization levels to filter the provider by.""" - sort: Annotated[ - OptionalNullable[ProviderSort], PlainValidator(validate_open_enum(False)) - ] = UNSET + sort: OptionalNullable[OpenResponsesRequestSort] = UNSET r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" max_price: Optional[OpenResponsesRequestMaxPrice] = None r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - min_throughput: OptionalNullable[float] = UNSET - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" + preferred_min_throughput: OptionalNullable[PreferredMinThroughput] = UNSET + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" - max_latency: OptionalNullable[float] = UNSET - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" + preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" @model_serializer(mode="wrap") def serialize_model(self, handler): @@ -318,8 +359,8 @@ def serialize_model(self, handler): "quantizations", "sort", "max_price", - "min_throughput", - "max_latency", + "preferred_min_throughput", + "preferred_max_latency", ] nullable_fields = [ "allow_fallbacks", @@ -332,8 +373,8 @@ def serialize_model(self, handler): "ignore", "quantizations", "sort", - "min_throughput", - "max_latency", + "preferred_min_throughput", + "preferred_max_latency", ] null_default_fields = [] @@ -381,32 +422,12 @@ class OpenResponsesRequestPluginResponseHealing(BaseModel): IDFileParser = Literal["file-parser",] -OpenResponsesRequestPdfEngine = Union[ - Literal[ - "mistral-ocr", - "pdf-text", - "native", - ], - UnrecognizedStr, -] - - -class OpenResponsesRequestPdfTypedDict(TypedDict): - engine: NotRequired[OpenResponsesRequestPdfEngine] - - -class OpenResponsesRequestPdf(BaseModel): - engine: Annotated[ - Optional[OpenResponsesRequestPdfEngine], - PlainValidator(validate_open_enum(False)), - ] = None - - class OpenResponsesRequestPluginFileParserTypedDict(TypedDict): id: IDFileParser enabled: NotRequired[bool] r"""Set to false to disable the file-parser plugin for this request. Defaults to true.""" - pdf: NotRequired[OpenResponsesRequestPdfTypedDict] + pdf: NotRequired[PDFParserOptionsTypedDict] + r"""Options for PDF parsing.""" class OpenResponsesRequestPluginFileParser(BaseModel): @@ -415,28 +436,21 @@ class OpenResponsesRequestPluginFileParser(BaseModel): enabled: Optional[bool] = None r"""Set to false to disable the file-parser plugin for this request. Defaults to true.""" - pdf: Optional[OpenResponsesRequestPdf] = None + pdf: Optional[PDFParserOptions] = None + r"""Options for PDF parsing.""" IDWeb = Literal["web",] -OpenResponsesRequestEngine = Union[ - Literal[ - "native", - "exa", - ], - UnrecognizedStr, -] - - class OpenResponsesRequestPluginWebTypedDict(TypedDict): id: IDWeb enabled: NotRequired[bool] r"""Set to false to disable the web-search plugin for this request. Defaults to true.""" max_results: NotRequired[float] search_prompt: NotRequired[str] - engine: NotRequired[OpenResponsesRequestEngine] + engine: NotRequired[WebSearchEngine] + r"""The search engine to use for web search.""" class OpenResponsesRequestPluginWeb(BaseModel): @@ -450,8 +464,9 @@ class OpenResponsesRequestPluginWeb(BaseModel): search_prompt: Optional[str] = None engine: Annotated[ - Optional[OpenResponsesRequestEngine], PlainValidator(validate_open_enum(False)) + Optional[WebSearchEngine], PlainValidator(validate_open_enum(False)) ] = None + r"""The search engine to use for web search.""" IDModeration = Literal["moderation",] @@ -465,11 +480,33 @@ class OpenResponsesRequestPluginModeration(BaseModel): id: IDModeration +IDAutoRouter = Literal["auto-router",] + + +class OpenResponsesRequestPluginAutoRouterTypedDict(TypedDict): + id: IDAutoRouter + enabled: NotRequired[bool] + r"""Set to false to disable the auto-router plugin for this request. Defaults to true.""" + allowed_models: NotRequired[List[str]] + r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + + +class OpenResponsesRequestPluginAutoRouter(BaseModel): + id: IDAutoRouter + + enabled: Optional[bool] = None + r"""Set to false to disable the auto-router plugin for this request. Defaults to true.""" + + allowed_models: Optional[List[str]] = None + r"""List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., \"anthropic/*\" matches all Anthropic models). When not specified, uses the default supported models list.""" + + OpenResponsesRequestPluginUnionTypedDict = TypeAliasType( "OpenResponsesRequestPluginUnionTypedDict", Union[ OpenResponsesRequestPluginModerationTypedDict, OpenResponsesRequestPluginResponseHealingTypedDict, + OpenResponsesRequestPluginAutoRouterTypedDict, OpenResponsesRequestPluginFileParserTypedDict, OpenResponsesRequestPluginWebTypedDict, ], @@ -478,6 +515,7 @@ class OpenResponsesRequestPluginModeration(BaseModel): OpenResponsesRequestPluginUnion = Annotated[ Union[ + Annotated[OpenResponsesRequestPluginAutoRouter, Tag("auto-router")], Annotated[OpenResponsesRequestPluginModeration, Tag("moderation")], Annotated[OpenResponsesRequestPluginWeb, Tag("web")], Annotated[OpenResponsesRequestPluginFileParser, Tag("file-parser")], @@ -487,16 +525,6 @@ class OpenResponsesRequestPluginModeration(BaseModel): ] -OpenResponsesRequestRoute = Union[ - Literal[ - "fallback", - "sort", - ], - UnrecognizedStr, -] -r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.""" - - class OpenResponsesRequestTypedDict(TypedDict): r"""Request schema for Responses endpoint""" @@ -518,6 +546,10 @@ class OpenResponsesRequestTypedDict(TypedDict): temperature: NotRequired[Nullable[float]] top_p: NotRequired[Nullable[float]] top_k: NotRequired[float] + image_config: NotRequired[Dict[str, OpenResponsesRequestImageConfigTypedDict]] + r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.""" + modalities: NotRequired[List[ResponsesOutputModality]] + r"""Output modalities for the response. Supported values are \"text\" and \"image\".""" prompt_cache_key: NotRequired[Nullable[str]] previous_response_id: NotRequired[Nullable[str]] prompt: NotRequired[Nullable[OpenAIResponsesPromptTypedDict]] @@ -532,8 +564,6 @@ class OpenResponsesRequestTypedDict(TypedDict): r"""When multiple model providers are available, optionally indicate your routing preference.""" plugins: NotRequired[List[OpenResponsesRequestPluginUnionTypedDict]] r"""Plugins you want to enable for this request, including their settings.""" - route: NotRequired[Nullable[OpenResponsesRequestRoute]] - r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.""" user: NotRequired[str] r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.""" session_id: NotRequired[str] @@ -575,6 +605,18 @@ class OpenResponsesRequest(BaseModel): top_k: Optional[float] = None + image_config: Optional[Dict[str, OpenResponsesRequestImageConfig]] = None + r"""Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details.""" + + modalities: Optional[ + List[ + Annotated[ + ResponsesOutputModality, PlainValidator(validate_open_enum(False)) + ] + ] + ] = None + r"""Output modalities for the response. Supported values are \"text\" and \"image\".""" + prompt_cache_key: OptionalNullable[str] = UNSET previous_response_id: OptionalNullable[str] = UNSET @@ -612,12 +654,6 @@ class OpenResponsesRequest(BaseModel): plugins: Optional[List[OpenResponsesRequestPluginUnion]] = None r"""Plugins you want to enable for this request, including their settings.""" - route: Annotated[ - OptionalNullable[OpenResponsesRequestRoute], - PlainValidator(validate_open_enum(False)), - ] = UNSET - r"""Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria.""" - user: Optional[str] = None r"""A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters.""" @@ -641,6 +677,8 @@ def serialize_model(self, handler): "temperature", "top_p", "top_k", + "image_config", + "modalities", "prompt_cache_key", "previous_response_id", "prompt", @@ -653,7 +691,6 @@ def serialize_model(self, handler): "stream", "provider", "plugins", - "route", "user", "session_id", ] @@ -673,7 +710,6 @@ def serialize_model(self, handler): "safety_identifier", "truncation", "provider", - "route", ] null_default_fields = [] diff --git a/src/openrouter/components/parameter.py b/src/openrouter/components/parameter.py index ec65bc3..b84cbf0 100644 --- a/src/openrouter/components/parameter.py +++ b/src/openrouter/components/parameter.py @@ -28,6 +28,7 @@ "parallel_tool_calls", "include_reasoning", "reasoning", + "reasoning_effort", "web_search_options", "verbosity", ], diff --git a/src/openrouter/components/pdfparserengine.py b/src/openrouter/components/pdfparserengine.py new file mode 100644 index 0000000..4951697 --- /dev/null +++ b/src/openrouter/components/pdfparserengine.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +PDFParserEngine = Union[ + Literal[ + "mistral-ocr", + "pdf-text", + "native", + ], + UnrecognizedStr, +] +r"""The engine to use for parsing PDF files.""" diff --git a/src/openrouter/components/pdfparseroptions.py b/src/openrouter/components/pdfparseroptions.py new file mode 100644 index 0000000..13f177f --- /dev/null +++ b/src/openrouter/components/pdfparseroptions.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pdfparserengine import PDFParserEngine +from openrouter.types import BaseModel +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PDFParserOptionsTypedDict(TypedDict): + r"""Options for PDF parsing.""" + + engine: NotRequired[PDFParserEngine] + r"""The engine to use for parsing PDF files.""" + + +class PDFParserOptions(BaseModel): + r"""Options for PDF parsing.""" + + engine: Annotated[ + Optional[PDFParserEngine], PlainValidator(validate_open_enum(False)) + ] = None + r"""The engine to use for parsing PDF files.""" diff --git a/src/openrouter/components/percentilelatencycutoffs.py b/src/openrouter/components/percentilelatencycutoffs.py new file mode 100644 index 0000000..fa8175f --- /dev/null +++ b/src/openrouter/components/percentilelatencycutoffs.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class PercentileLatencyCutoffsTypedDict(TypedDict): + r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.""" + + p50: NotRequired[Nullable[float]] + r"""Maximum p50 latency (seconds)""" + p75: NotRequired[Nullable[float]] + r"""Maximum p75 latency (seconds)""" + p90: NotRequired[Nullable[float]] + r"""Maximum p90 latency (seconds)""" + p99: NotRequired[Nullable[float]] + r"""Maximum p99 latency (seconds)""" + + +class PercentileLatencyCutoffs(BaseModel): + r"""Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.""" + + p50: OptionalNullable[float] = UNSET + r"""Maximum p50 latency (seconds)""" + + p75: OptionalNullable[float] = UNSET + r"""Maximum p75 latency (seconds)""" + + p90: OptionalNullable[float] = UNSET + r"""Maximum p90 latency (seconds)""" + + p99: OptionalNullable[float] = UNSET + r"""Maximum p99 latency (seconds)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["p50", "p75", "p90", "p99"] + nullable_fields = ["p50", "p75", "p90", "p99"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/percentilestats.py b/src/openrouter/components/percentilestats.py new file mode 100644 index 0000000..78f7e0b --- /dev/null +++ b/src/openrouter/components/percentilestats.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing_extensions import TypedDict + + +class PercentileStatsTypedDict(TypedDict): + r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + + p50: float + r"""Median (50th percentile)""" + p75: float + r"""75th percentile""" + p90: float + r"""90th percentile""" + p99: float + r"""99th percentile""" + + +class PercentileStats(BaseModel): + r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + + p50: float + r"""Median (50th percentile)""" + + p75: float + r"""75th percentile""" + + p90: float + r"""90th percentile""" + + p99: float + r"""99th percentile""" diff --git a/src/openrouter/components/percentilethroughputcutoffs.py b/src/openrouter/components/percentilethroughputcutoffs.py new file mode 100644 index 0000000..17b28ce --- /dev/null +++ b/src/openrouter/components/percentilethroughputcutoffs.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class PercentileThroughputCutoffsTypedDict(TypedDict): + r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.""" + + p50: NotRequired[Nullable[float]] + r"""Minimum p50 throughput (tokens/sec)""" + p75: NotRequired[Nullable[float]] + r"""Minimum p75 throughput (tokens/sec)""" + p90: NotRequired[Nullable[float]] + r"""Minimum p90 throughput (tokens/sec)""" + p99: NotRequired[Nullable[float]] + r"""Minimum p99 throughput (tokens/sec)""" + + +class PercentileThroughputCutoffs(BaseModel): + r"""Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.""" + + p50: OptionalNullable[float] = UNSET + r"""Minimum p50 throughput (tokens/sec)""" + + p75: OptionalNullable[float] = UNSET + r"""Minimum p75 throughput (tokens/sec)""" + + p90: OptionalNullable[float] = UNSET + r"""Minimum p90 throughput (tokens/sec)""" + + p99: OptionalNullable[float] = UNSET + r"""Minimum p99 throughput (tokens/sec)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["p50", "p75", "p90", "p99"] + nullable_fields = ["p50", "p75", "p90", "p99"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/openrouter/components/preferredmaxlatency.py b/src/openrouter/components/preferredmaxlatency.py new file mode 100644 index 0000000..523f7c9 --- /dev/null +++ b/src/openrouter/components/preferredmaxlatency.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .percentilelatencycutoffs import ( + PercentileLatencyCutoffs, + PercentileLatencyCutoffsTypedDict, +) +from typing import Any, Union +from typing_extensions import TypeAliasType + + +PreferredMaxLatencyTypedDict = TypeAliasType( + "PreferredMaxLatencyTypedDict", Union[PercentileLatencyCutoffsTypedDict, float, Any] +) +r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + + +PreferredMaxLatency = TypeAliasType( + "PreferredMaxLatency", Union[PercentileLatencyCutoffs, float, Any] +) +r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" diff --git a/src/openrouter/components/preferredminthroughput.py b/src/openrouter/components/preferredminthroughput.py new file mode 100644 index 0000000..ceb4be7 --- /dev/null +++ b/src/openrouter/components/preferredminthroughput.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .percentilethroughputcutoffs import ( + PercentileThroughputCutoffs, + PercentileThroughputCutoffsTypedDict, +) +from typing import Any, Union +from typing_extensions import TypeAliasType + + +PreferredMinThroughputTypedDict = TypeAliasType( + "PreferredMinThroughputTypedDict", + Union[PercentileThroughputCutoffsTypedDict, float, Any], +) +r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + + +PreferredMinThroughput = TypeAliasType( + "PreferredMinThroughput", Union[PercentileThroughputCutoffs, float, Any] +) +r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" diff --git a/src/openrouter/components/providername.py b/src/openrouter/components/providername.py index ed50966..8a04187 100644 --- a/src/openrouter/components/providername.py +++ b/src/openrouter/components/providername.py @@ -33,7 +33,6 @@ "Fireworks", "Friendli", "GMICloud", - "GoPomelo", "Google", "Google AI Studio", "Groq", @@ -63,13 +62,14 @@ "Phala", "Relace", "SambaNova", + "Seed", "SiliconFlow", "Sourceful", "Stealth", "StreamLake", "Switchpoint", - "Targon", "Together", + "Upstage", "Venice", "WandB", "Xiaomi", diff --git a/src/openrouter/components/providerpreferences.py b/src/openrouter/components/providerpreferences.py new file mode 100644 index 0000000..b0d41b0 --- /dev/null +++ b/src/openrouter/components/providerpreferences.py @@ -0,0 +1,355 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datacollection import DataCollection +from .preferredmaxlatency import PreferredMaxLatency, PreferredMaxLatencyTypedDict +from .preferredminthroughput import ( + PreferredMinThroughput, + PreferredMinThroughputTypedDict, +) +from .providername import ProviderName +from .providersort import ProviderSort +from .quantization import Quantization +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +ProviderPreferencesOrderTypedDict = TypeAliasType( + "ProviderPreferencesOrderTypedDict", Union[ProviderName, str] +) + + +ProviderPreferencesOrder = TypeAliasType( + "ProviderPreferencesOrder", + Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], +) + + +ProviderPreferencesOnlyTypedDict = TypeAliasType( + "ProviderPreferencesOnlyTypedDict", Union[ProviderName, str] +) + + +ProviderPreferencesOnly = TypeAliasType( + "ProviderPreferencesOnly", + Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], +) + + +ProviderPreferencesIgnoreTypedDict = TypeAliasType( + "ProviderPreferencesIgnoreTypedDict", Union[ProviderName, str] +) + + +ProviderPreferencesIgnore = TypeAliasType( + "ProviderPreferencesIgnore", + Union[Annotated[ProviderName, PlainValidator(validate_open_enum(False))], str], +) + + +SortEnum = Union[ + Literal[ + "price", + "throughput", + "latency", + ], + UnrecognizedStr, +] + + +ProviderSortConfigEnum = Literal[ + "price", + "throughput", + "latency", +] + + +ProviderPreferencesPartition = Union[ + Literal[ + "model", + "none", + ], + UnrecognizedStr, +] + + +class ProviderPreferencesProviderSortConfigTypedDict(TypedDict): + by: NotRequired[Nullable[ProviderSort]] + partition: NotRequired[Nullable[ProviderPreferencesPartition]] + + +class ProviderPreferencesProviderSortConfig(BaseModel): + by: Annotated[ + OptionalNullable[ProviderSort], PlainValidator(validate_open_enum(False)) + ] = UNSET + + partition: Annotated[ + OptionalNullable[ProviderPreferencesPartition], + PlainValidator(validate_open_enum(False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["by", "partition"] + nullable_fields = ["by", "partition"] + 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 + + +ProviderSortConfigUnionTypedDict = TypeAliasType( + "ProviderSortConfigUnionTypedDict", + Union[ProviderPreferencesProviderSortConfigTypedDict, ProviderSortConfigEnum], +) + + +ProviderSortConfigUnion = TypeAliasType( + "ProviderSortConfigUnion", + Union[ProviderPreferencesProviderSortConfig, ProviderSortConfigEnum], +) + + +ProviderPreferencesProviderSort = Union[ + Literal[ + "price", + "throughput", + "latency", + ], + UnrecognizedStr, +] + + +ProviderPreferencesSortUnionTypedDict = TypeAliasType( + "ProviderPreferencesSortUnionTypedDict", + Union[ProviderPreferencesProviderSort, ProviderSortConfigUnionTypedDict, SortEnum], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +ProviderPreferencesSortUnion = TypeAliasType( + "ProviderPreferencesSortUnion", + Union[ + Annotated[ + ProviderPreferencesProviderSort, PlainValidator(validate_open_enum(False)) + ], + ProviderSortConfigUnion, + Annotated[SortEnum, PlainValidator(validate_open_enum(False))], + ], +) +r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" + + +class ProviderPreferencesMaxPriceTypedDict(TypedDict): + r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" + + prompt: NotRequired[str] + r"""A value in string format that is a large number""" + completion: NotRequired[str] + r"""A value in string format that is a large number""" + image: NotRequired[str] + r"""A value in string format that is a large number""" + audio: NotRequired[str] + r"""A value in string format that is a large number""" + request: NotRequired[str] + r"""A value in string format that is a large number""" + + +class ProviderPreferencesMaxPrice(BaseModel): + r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" + + prompt: Optional[str] = None + r"""A value in string format that is a large number""" + + completion: Optional[str] = None + r"""A value in string format that is a large number""" + + image: Optional[str] = None + r"""A value in string format that is a large number""" + + audio: Optional[str] = None + r"""A value in string format that is a large number""" + + request: Optional[str] = None + r"""A value in string format that is a large number""" + + +class ProviderPreferencesTypedDict(TypedDict): + r"""Provider routing preferences for the request.""" + + allow_fallbacks: NotRequired[Nullable[bool]] + r"""Whether to allow backup providers to serve requests + - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + """ + require_parameters: NotRequired[Nullable[bool]] + r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" + data_collection: NotRequired[Nullable[DataCollection]] + r"""Data collection setting. If no available model provider meets the requirement, your request will return an error. + - allow: (default) allow providers which store user data non-transiently and may train on it + + - deny: use only providers which do not collect user data. + """ + zdr: NotRequired[Nullable[bool]] + r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" + enforce_distillable_text: NotRequired[Nullable[bool]] + r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" + order: NotRequired[Nullable[List[ProviderPreferencesOrderTypedDict]]] + r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" + only: NotRequired[Nullable[List[ProviderPreferencesOnlyTypedDict]]] + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" + ignore: NotRequired[Nullable[List[ProviderPreferencesIgnoreTypedDict]]] + r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" + quantizations: NotRequired[Nullable[List[Quantization]]] + r"""A list of quantization levels to filter the provider by.""" + sort: NotRequired[Nullable[ProviderPreferencesSortUnionTypedDict]] + max_price: NotRequired[ProviderPreferencesMaxPriceTypedDict] + r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" + preferred_min_throughput: NotRequired[Nullable[PreferredMinThroughputTypedDict]] + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + preferred_max_latency: NotRequired[Nullable[PreferredMaxLatencyTypedDict]] + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + + +class ProviderPreferences(BaseModel): + r"""Provider routing preferences for the request.""" + + allow_fallbacks: OptionalNullable[bool] = UNSET + r"""Whether to allow backup providers to serve requests + - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + """ + + require_parameters: OptionalNullable[bool] = UNSET + r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" + + data_collection: Annotated[ + OptionalNullable[DataCollection], PlainValidator(validate_open_enum(False)) + ] = UNSET + r"""Data collection setting. If no available model provider meets the requirement, your request will return an error. + - allow: (default) allow providers which store user data non-transiently and may train on it + + - deny: use only providers which do not collect user data. + """ + + zdr: OptionalNullable[bool] = UNSET + r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" + + enforce_distillable_text: OptionalNullable[bool] = UNSET + r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" + + order: OptionalNullable[List[ProviderPreferencesOrder]] = UNSET + r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" + + only: OptionalNullable[List[ProviderPreferencesOnly]] = UNSET + r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" + + ignore: OptionalNullable[List[ProviderPreferencesIgnore]] = UNSET + r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" + + quantizations: OptionalNullable[ + List[Annotated[Quantization, PlainValidator(validate_open_enum(False))]] + ] = UNSET + r"""A list of quantization levels to filter the provider by.""" + + sort: OptionalNullable[ProviderPreferencesSortUnion] = UNSET + + max_price: Optional[ProviderPreferencesMaxPrice] = None + r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" + + preferred_min_throughput: OptionalNullable[PreferredMinThroughput] = UNSET + r"""Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + + preferred_max_latency: OptionalNullable[PreferredMaxLatency] = UNSET + r"""Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "allow_fallbacks", + "require_parameters", + "data_collection", + "zdr", + "enforce_distillable_text", + "order", + "only", + "ignore", + "quantizations", + "sort", + "max_price", + "preferred_min_throughput", + "preferred_max_latency", + ] + nullable_fields = [ + "allow_fallbacks", + "require_parameters", + "data_collection", + "zdr", + "enforce_distillable_text", + "order", + "only", + "ignore", + "quantizations", + "sort", + "preferred_min_throughput", + "preferred_max_latency", + ] + 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 diff --git a/src/openrouter/components/providersort.py b/src/openrouter/components/providersort.py index 8a8d415..c4cbc29 100644 --- a/src/openrouter/components/providersort.py +++ b/src/openrouter/components/providersort.py @@ -13,4 +13,3 @@ ], UnrecognizedStr, ] -r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" diff --git a/src/openrouter/components/providersortconfig.py b/src/openrouter/components/providersortconfig.py new file mode 100644 index 0000000..c53a2fa --- /dev/null +++ b/src/openrouter/components/providersortconfig.py @@ -0,0 +1,71 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .providersort import ProviderSort +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +Partition = Union[ + Literal[ + "model", + "none", + ], + UnrecognizedStr, +] + + +class ProviderSortConfigTypedDict(TypedDict): + by: NotRequired[Nullable[ProviderSort]] + partition: NotRequired[Nullable[Partition]] + + +class ProviderSortConfig(BaseModel): + by: Annotated[ + OptionalNullable[ProviderSort], PlainValidator(validate_open_enum(False)) + ] = UNSET + + partition: Annotated[ + OptionalNullable[Partition], PlainValidator(validate_open_enum(False)) + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["by", "partition"] + nullable_fields = ["by", "partition"] + 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 diff --git a/src/openrouter/components/providersortunion.py b/src/openrouter/components/providersortunion.py new file mode 100644 index 0000000..52ed036 --- /dev/null +++ b/src/openrouter/components/providersortunion.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .providersort import ProviderSort +from .providersortconfig import ProviderSortConfig, ProviderSortConfigTypedDict +from openrouter.utils import validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Union +from typing_extensions import Annotated, TypeAliasType + + +ProviderSortUnionTypedDict = TypeAliasType( + "ProviderSortUnionTypedDict", Union[ProviderSortConfigTypedDict, ProviderSort] +) + + +ProviderSortUnion = TypeAliasType( + "ProviderSortUnion", + Union[ + ProviderSortConfig, + Annotated[ProviderSort, PlainValidator(validate_open_enum(False))], + ], +) diff --git a/src/openrouter/components/publicendpoint.py b/src/openrouter/components/publicendpoint.py index c106c8b..bcf541e 100644 --- a/src/openrouter/components/publicendpoint.py +++ b/src/openrouter/components/publicendpoint.py @@ -3,6 +3,7 @@ from __future__ import annotations from .endpointstatus import EndpointStatus from .parameter import Parameter +from .percentilestats import PercentileStats, PercentileStatsTypedDict from .providername import ProviderName from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr from openrouter.utils import validate_open_enum @@ -111,6 +112,9 @@ class PublicEndpointTypedDict(TypedDict): supported_parameters: List[Parameter] uptime_last_30m: Nullable[float] supports_implicit_caching: bool + latency_last_30m: Nullable[PercentileStatsTypedDict] + r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + throughput_last_30m: Nullable[PercentileStatsTypedDict] status: NotRequired[EndpointStatus] @@ -145,6 +149,11 @@ class PublicEndpoint(BaseModel): supports_implicit_caching: bool + latency_last_30m: Nullable[PercentileStats] + r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + + throughput_last_30m: Nullable[PercentileStats] + status: Annotated[ Optional[EndpointStatus], PlainValidator(validate_open_enum(True)) ] = None @@ -157,6 +166,8 @@ def serialize_model(self, handler): "max_completion_tokens", "max_prompt_tokens", "uptime_last_30m", + "latency_last_30m", + "throughput_last_30m", ] null_default_fields = [] diff --git a/src/openrouter/components/responsesoutputitem.py b/src/openrouter/components/responsesoutputitem.py index 28966bd..5aff987 100644 --- a/src/openrouter/components/responsesoutputitem.py +++ b/src/openrouter/components/responsesoutputitem.py @@ -38,8 +38,8 @@ ResponsesOutputItemFileSearchCallTypedDict, ResponsesImageGenerationCallTypedDict, ResponsesOutputMessageTypedDict, - ResponsesOutputItemReasoningTypedDict, ResponsesOutputItemFunctionCallTypedDict, + ResponsesOutputItemReasoningTypedDict, ], ) r"""An output item from the response""" diff --git a/src/openrouter/components/responsesoutputitemreasoning.py b/src/openrouter/components/responsesoutputitemreasoning.py index 99fe60e..a94fb36 100644 --- a/src/openrouter/components/responsesoutputitemreasoning.py +++ b/src/openrouter/components/responsesoutputitemreasoning.py @@ -9,10 +9,14 @@ OptionalNullable, UNSET, UNSET_SENTINEL, + UnrecognizedStr, ) +from openrouter.utils import validate_open_enum +import pydantic from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator from typing import List, Literal, Optional, Union -from typing_extensions import NotRequired, TypeAliasType, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict ResponsesOutputItemReasoningType = Literal["reasoning",] @@ -47,6 +51,20 @@ ) +ResponsesOutputItemReasoningFormat = Union[ + Literal[ + "unknown", + "openai-responses-v1", + "azure-openai-responses-v1", + "xai-responses-v1", + "anthropic-claude-v1", + "google-gemini-v1", + ], + UnrecognizedStr, +] +r"""The format of the reasoning content""" + + class ResponsesOutputItemReasoningTypedDict(TypedDict): r"""An output item containing reasoning""" @@ -56,6 +74,10 @@ class ResponsesOutputItemReasoningTypedDict(TypedDict): content: NotRequired[List[ReasoningTextContentTypedDict]] encrypted_content: NotRequired[Nullable[str]] status: NotRequired[ResponsesOutputItemReasoningStatusUnionTypedDict] + signature: NotRequired[Nullable[str]] + r"""A signature for the reasoning content, used for verification""" + format_: NotRequired[Nullable[ResponsesOutputItemReasoningFormat]] + r"""The format of the reasoning content""" class ResponsesOutputItemReasoning(BaseModel): @@ -73,10 +95,28 @@ class ResponsesOutputItemReasoning(BaseModel): status: Optional[ResponsesOutputItemReasoningStatusUnion] = None + signature: OptionalNullable[str] = UNSET + r"""A signature for the reasoning content, used for verification""" + + format_: Annotated[ + Annotated[ + OptionalNullable[ResponsesOutputItemReasoningFormat], + PlainValidator(validate_open_enum(False)), + ], + pydantic.Field(alias="format"), + ] = UNSET + r"""The format of the reasoning content""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["content", "encrypted_content", "status"] - nullable_fields = ["encrypted_content"] + optional_fields = [ + "content", + "encrypted_content", + "status", + "signature", + "format", + ] + nullable_fields = ["encrypted_content", "signature", "format"] null_default_fields = [] serialized = handler(self) diff --git a/src/openrouter/components/responsesoutputmodality.py b/src/openrouter/components/responsesoutputmodality.py new file mode 100644 index 0000000..a259061 --- /dev/null +++ b/src/openrouter/components/responsesoutputmodality.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +ResponsesOutputModality = Union[ + Literal[ + "text", + "image", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/websearchengine.py b/src/openrouter/components/websearchengine.py new file mode 100644 index 0000000..40dafa8 --- /dev/null +++ b/src/openrouter/components/websearchengine.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import UnrecognizedStr +from typing import Literal, Union + + +WebSearchEngine = Union[ + Literal[ + "native", + "exa", + ], + UnrecognizedStr, +] +r"""The search engine to use for web search.""" diff --git a/src/openrouter/embeddings.py b/src/openrouter/embeddings.py index 3ea39af..20e9512 100644 --- a/src/openrouter/embeddings.py +++ b/src/openrouter/embeddings.py @@ -28,8 +28,7 @@ def generate( user: Optional[str] = None, provider: Optional[ Union[ - operations.CreateEmbeddingsProvider, - operations.CreateEmbeddingsProviderTypedDict, + components.ProviderPreferences, components.ProviderPreferencesTypedDict ] ] = None, input_type: Optional[str] = None, @@ -48,7 +47,7 @@ def generate( :param encoding_format: :param dimensions: :param user: - :param provider: + :param provider: Provider routing preferences for the request. :param input_type: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -73,7 +72,7 @@ def generate( dimensions=dimensions, user=user, provider=utils.get_pydantic_model( - provider, Optional[operations.CreateEmbeddingsProvider] + provider, Optional[components.ProviderPreferences] ), input_type=input_type, ) @@ -216,8 +215,7 @@ async def generate_async( user: Optional[str] = None, provider: Optional[ Union[ - operations.CreateEmbeddingsProvider, - operations.CreateEmbeddingsProviderTypedDict, + components.ProviderPreferences, components.ProviderPreferencesTypedDict ] ] = None, input_type: Optional[str] = None, @@ -236,7 +234,7 @@ async def generate_async( :param encoding_format: :param dimensions: :param user: - :param provider: + :param provider: Provider routing preferences for the request. :param input_type: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -261,7 +259,7 @@ async def generate_async( dimensions=dimensions, user=user, provider=utils.get_pydantic_model( - provider, Optional[operations.CreateEmbeddingsProvider] + provider, Optional[components.ProviderPreferences] ), input_type=input_type, ) diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index 9466002..be7e440 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -40,8 +40,6 @@ ContentTypedDict, CreateEmbeddingsData, CreateEmbeddingsDataTypedDict, - CreateEmbeddingsProvider, - CreateEmbeddingsProviderTypedDict, CreateEmbeddingsRequest, CreateEmbeddingsRequestTypedDict, CreateEmbeddingsResponse, @@ -51,22 +49,14 @@ Embedding, EmbeddingTypedDict, EncodingFormat, - Ignore, - IgnoreTypedDict, ImageURL, ImageURLTypedDict, Input, InputTypedDict, InputUnion, InputUnionTypedDict, - MaxPrice, - MaxPriceTypedDict, Object, ObjectEmbedding, - Only, - OnlyTypedDict, - Order, - OrderTypedDict, TypeImageURL, TypeText, Usage, @@ -135,7 +125,6 @@ from .getparameters import ( GetParametersData, GetParametersDataTypedDict, - GetParametersProvider, GetParametersRequest, GetParametersRequestTypedDict, GetParametersResponse, @@ -216,8 +205,6 @@ "CreateCoinbaseChargeSecurityTypedDict", "CreateEmbeddingsData", "CreateEmbeddingsDataTypedDict", - "CreateEmbeddingsProvider", - "CreateEmbeddingsProviderTypedDict", "CreateEmbeddingsRequest", "CreateEmbeddingsRequestTypedDict", "CreateEmbeddingsResponse", @@ -271,7 +258,6 @@ "GetModelsRequestTypedDict", "GetParametersData", "GetParametersDataTypedDict", - "GetParametersProvider", "GetParametersRequest", "GetParametersRequestTypedDict", "GetParametersResponse", @@ -282,8 +268,6 @@ "GetUserActivityRequestTypedDict", "GetUserActivityResponse", "GetUserActivityResponseTypedDict", - "Ignore", - "IgnoreTypedDict", "ImageURL", "ImageURLTypedDict", "Input", @@ -308,16 +292,10 @@ "ListRequestTypedDict", "ListResponse", "ListResponseTypedDict", - "MaxPrice", - "MaxPriceTypedDict", "Metadata", "MetadataTypedDict", "Object", "ObjectEmbedding", - "Only", - "OnlyTypedDict", - "Order", - "OrderTypedDict", "RateLimit", "RateLimitTypedDict", "SendChatCompletionRequestResponse", @@ -372,8 +350,6 @@ "ContentTypedDict": ".createembeddings", "CreateEmbeddingsData": ".createembeddings", "CreateEmbeddingsDataTypedDict": ".createembeddings", - "CreateEmbeddingsProvider": ".createembeddings", - "CreateEmbeddingsProviderTypedDict": ".createembeddings", "CreateEmbeddingsRequest": ".createembeddings", "CreateEmbeddingsRequestTypedDict": ".createembeddings", "CreateEmbeddingsResponse": ".createembeddings", @@ -383,22 +359,14 @@ "Embedding": ".createembeddings", "EmbeddingTypedDict": ".createembeddings", "EncodingFormat": ".createembeddings", - "Ignore": ".createembeddings", - "IgnoreTypedDict": ".createembeddings", "ImageURL": ".createembeddings", "ImageURLTypedDict": ".createembeddings", "Input": ".createembeddings", "InputTypedDict": ".createembeddings", "InputUnion": ".createembeddings", "InputUnionTypedDict": ".createembeddings", - "MaxPrice": ".createembeddings", - "MaxPriceTypedDict": ".createembeddings", "Object": ".createembeddings", "ObjectEmbedding": ".createembeddings", - "Only": ".createembeddings", - "OnlyTypedDict": ".createembeddings", - "Order": ".createembeddings", - "OrderTypedDict": ".createembeddings", "TypeImageURL": ".createembeddings", "TypeText": ".createembeddings", "Usage": ".createembeddings", @@ -450,7 +418,6 @@ "GetModelsRequestTypedDict": ".getmodels", "GetParametersData": ".getparameters", "GetParametersDataTypedDict": ".getparameters", - "GetParametersProvider": ".getparameters", "GetParametersRequest": ".getparameters", "GetParametersRequestTypedDict": ".getparameters", "GetParametersResponse": ".getparameters", diff --git a/src/openrouter/operations/createembeddings.py b/src/openrouter/operations/createembeddings.py index a8b90c0..6b0f07d 100644 --- a/src/openrouter/operations/createembeddings.py +++ b/src/openrouter/operations/createembeddings.py @@ -1,22 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.components import ( - datacollection as components_datacollection, - providername as components_providername, - providersort as components_providersort, - quantization as components_quantization, -) -from openrouter.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, - UnrecognizedStr, -) +from openrouter.components import providerpreferences as components_providerpreferences +from openrouter.types import BaseModel, UnrecognizedStr from openrouter.utils import get_discriminator, validate_open_enum -from pydantic import Discriminator, Tag, model_serializer +from pydantic import Discriminator, Tag from pydantic.functional_validators import PlainValidator from typing import List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -100,254 +88,14 @@ class Input(BaseModel): ] -OrderTypedDict = TypeAliasType( - "OrderTypedDict", Union[components_providername.ProviderName, str] -) - - -Order = TypeAliasType( - "Order", - Union[ - Annotated[ - components_providername.ProviderName, - PlainValidator(validate_open_enum(False)), - ], - str, - ], -) - - -OnlyTypedDict = TypeAliasType( - "OnlyTypedDict", Union[components_providername.ProviderName, str] -) - - -Only = TypeAliasType( - "Only", - Union[ - Annotated[ - components_providername.ProviderName, - PlainValidator(validate_open_enum(False)), - ], - str, - ], -) - - -IgnoreTypedDict = TypeAliasType( - "IgnoreTypedDict", Union[components_providername.ProviderName, str] -) - - -Ignore = TypeAliasType( - "Ignore", - Union[ - Annotated[ - components_providername.ProviderName, - PlainValidator(validate_open_enum(False)), - ], - str, - ], -) - - -class MaxPriceTypedDict(TypedDict): - r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - - prompt: NotRequired[str] - r"""A value in string format that is a large number""" - completion: NotRequired[str] - r"""A value in string format that is a large number""" - image: NotRequired[str] - r"""A value in string format that is a large number""" - audio: NotRequired[str] - r"""A value in string format that is a large number""" - request: NotRequired[str] - r"""A value in string format that is a large number""" - - -class MaxPrice(BaseModel): - r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - - prompt: Optional[str] = None - r"""A value in string format that is a large number""" - - completion: Optional[str] = None - r"""A value in string format that is a large number""" - - image: Optional[str] = None - r"""A value in string format that is a large number""" - - audio: Optional[str] = None - r"""A value in string format that is a large number""" - - request: Optional[str] = None - r"""A value in string format that is a large number""" - - -class CreateEmbeddingsProviderTypedDict(TypedDict): - allow_fallbacks: NotRequired[Nullable[bool]] - r"""Whether to allow backup providers to serve requests - - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - """ - require_parameters: NotRequired[Nullable[bool]] - r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" - data_collection: NotRequired[Nullable[components_datacollection.DataCollection]] - r"""Data collection setting. If no available model provider meets the requirement, your request will return an error. - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. - """ - zdr: NotRequired[Nullable[bool]] - r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" - enforce_distillable_text: NotRequired[Nullable[bool]] - r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - order: NotRequired[Nullable[List[OrderTypedDict]]] - r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" - only: NotRequired[Nullable[List[OnlyTypedDict]]] - r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - ignore: NotRequired[Nullable[List[IgnoreTypedDict]]] - r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" - quantizations: NotRequired[Nullable[List[components_quantization.Quantization]]] - r"""A list of quantization levels to filter the provider by.""" - sort: NotRequired[Nullable[components_providersort.ProviderSort]] - r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" - max_price: NotRequired[MaxPriceTypedDict] - r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - min_throughput: NotRequired[Nullable[float]] - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" - max_latency: NotRequired[Nullable[float]] - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" - - -class CreateEmbeddingsProvider(BaseModel): - allow_fallbacks: OptionalNullable[bool] = UNSET - r"""Whether to allow backup providers to serve requests - - true: (default) when the primary provider (or your custom providers in \"order\") is unavailable, use the next best provider. - - false: use only the primary/custom provider, and return the upstream error if it's unavailable. - - """ - - require_parameters: OptionalNullable[bool] = UNSET - r"""Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.""" - - data_collection: Annotated[ - OptionalNullable[components_datacollection.DataCollection], - PlainValidator(validate_open_enum(False)), - ] = UNSET - r"""Data collection setting. If no available model provider meets the requirement, your request will return an error. - - allow: (default) allow providers which store user data non-transiently and may train on it - - - deny: use only providers which do not collect user data. - """ - - zdr: OptionalNullable[bool] = UNSET - r"""Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.""" - - enforce_distillable_text: OptionalNullable[bool] = UNSET - r"""Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.""" - - order: OptionalNullable[List[Order]] = UNSET - r"""An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.""" - - only: OptionalNullable[List[Only]] = UNSET - r"""List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.""" - - ignore: OptionalNullable[List[Ignore]] = UNSET - r"""List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.""" - - quantizations: OptionalNullable[ - List[ - Annotated[ - components_quantization.Quantization, - PlainValidator(validate_open_enum(False)), - ] - ] - ] = UNSET - r"""A list of quantization levels to filter the provider by.""" - - sort: Annotated[ - OptionalNullable[components_providersort.ProviderSort], - PlainValidator(validate_open_enum(False)), - ] = UNSET - r"""The sorting strategy to use for this request, if \"order\" is not specified. When set, no load balancing is performed.""" - - max_price: Optional[MaxPrice] = None - r"""The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.""" - - min_throughput: OptionalNullable[float] = UNSET - r"""The minimum throughput (in tokens per second) required for this request. Only providers serving the model with at least this throughput will be used.""" - - max_latency: OptionalNullable[float] = UNSET - r"""The maximum latency (in seconds) allowed for this request. Only providers serving the model with better than this latency will be used.""" - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = [ - "allow_fallbacks", - "require_parameters", - "data_collection", - "zdr", - "enforce_distillable_text", - "order", - "only", - "ignore", - "quantizations", - "sort", - "max_price", - "min_throughput", - "max_latency", - ] - nullable_fields = [ - "allow_fallbacks", - "require_parameters", - "data_collection", - "zdr", - "enforce_distillable_text", - "order", - "only", - "ignore", - "quantizations", - "sort", - "min_throughput", - "max_latency", - ] - 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 CreateEmbeddingsRequestTypedDict(TypedDict): input: InputUnionTypedDict model: str encoding_format: NotRequired[EncodingFormat] dimensions: NotRequired[int] user: NotRequired[str] - provider: NotRequired[CreateEmbeddingsProviderTypedDict] + provider: NotRequired[components_providerpreferences.ProviderPreferencesTypedDict] + r"""Provider routing preferences for the request.""" input_type: NotRequired[str] @@ -364,7 +112,8 @@ class CreateEmbeddingsRequest(BaseModel): user: Optional[str] = None - provider: Optional[CreateEmbeddingsProvider] = None + provider: Optional[components_providerpreferences.ProviderPreferences] = None + r"""Provider routing preferences for the request.""" input_type: Optional[str] = None diff --git a/src/openrouter/operations/getparameters.py b/src/openrouter/operations/getparameters.py index 70c323e..2ae70a2 100644 --- a/src/openrouter/operations/getparameters.py +++ b/src/openrouter/operations/getparameters.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from openrouter.components import providername as components_providername from openrouter.types import BaseModel, UnrecognizedStr from openrouter.utils import ( FieldMetadata, @@ -32,86 +33,10 @@ class GetParametersSecurity(BaseModel): ] -GetParametersProvider = Union[ - Literal[ - "AI21", - "AionLabs", - "Alibaba", - "Amazon Bedrock", - "Amazon Nova", - "Anthropic", - "Arcee AI", - "AtlasCloud", - "Avian", - "Azure", - "BaseTen", - "BytePlus", - "Black Forest Labs", - "Cerebras", - "Chutes", - "Cirrascale", - "Clarifai", - "Cloudflare", - "Cohere", - "Crusoe", - "DeepInfra", - "DeepSeek", - "Featherless", - "Fireworks", - "Friendli", - "GMICloud", - "GoPomelo", - "Google", - "Google AI Studio", - "Groq", - "Hyperbolic", - "Inception", - "InferenceNet", - "Infermatic", - "Inflection", - "Liquid", - "Mara", - "Mancer 2", - "Minimax", - "ModelRun", - "Mistral", - "Modular", - "Moonshot AI", - "Morph", - "NCompass", - "Nebius", - "NextBit", - "Novita", - "Nvidia", - "OpenAI", - "OpenInference", - "Parasail", - "Perplexity", - "Phala", - "Relace", - "SambaNova", - "SiliconFlow", - "Sourceful", - "Stealth", - "StreamLake", - "Switchpoint", - "Targon", - "Together", - "Venice", - "WandB", - "Xiaomi", - "xAI", - "Z.AI", - "FakeProvider", - ], - UnrecognizedStr, -] - - class GetParametersRequestTypedDict(TypedDict): author: str slug: str - provider: NotRequired[GetParametersProvider] + provider: NotRequired[components_providername.ProviderName] class GetParametersRequest(BaseModel): @@ -125,7 +50,8 @@ class GetParametersRequest(BaseModel): provider: Annotated[ Annotated[ - Optional[GetParametersProvider], PlainValidator(validate_open_enum(False)) + Optional[components_providername.ProviderName], + PlainValidator(validate_open_enum(False)), ], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None @@ -154,6 +80,7 @@ class GetParametersRequest(BaseModel): "parallel_tool_calls", "include_reasoning", "reasoning", + "reasoning_effort", "web_search_options", "verbosity", ], diff --git a/src/openrouter/parameters.py b/src/openrouter/parameters.py index 5206f57..d645cb1 100644 --- a/src/openrouter/parameters.py +++ b/src/openrouter/parameters.py @@ -20,7 +20,7 @@ def get_parameters( ], author: str, slug: str, - provider: Optional[operations.GetParametersProvider] = None, + provider: Optional[components.ProviderName] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -132,7 +132,7 @@ async def get_parameters_async( ], author: str, slug: str, - provider: Optional[operations.GetParametersProvider] = None, + provider: Optional[components.ProviderName] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, diff --git a/src/openrouter/responses.py b/src/openrouter/responses.py index 18f71dd..b1cec20 100644 --- a/src/openrouter/responses.py +++ b/src/openrouter/responses.py @@ -58,6 +58,13 @@ def send( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -84,7 +91,6 @@ def send( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -110,6 +116,8 @@ def send( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -121,7 +129,6 @@ def send( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -171,6 +178,13 @@ def send( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -197,7 +211,6 @@ def send( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -223,6 +236,8 @@ def send( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -234,7 +249,6 @@ def send( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -283,6 +297,13 @@ def send( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -309,7 +330,6 @@ def send( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -335,6 +355,8 @@ def send( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -346,7 +368,6 @@ def send( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -390,6 +411,8 @@ def send( temperature=temperature, top_p=top_p, top_k=top_k, + image_config=image_config, + modalities=modalities, prompt_cache_key=prompt_cache_key, previous_response_id=previous_response_id, prompt=utils.get_pydantic_model( @@ -407,7 +430,6 @@ def send( plugins=utils.get_pydantic_model( plugins, Optional[List[components.OpenResponsesRequestPluginUnion]] ), - route=route, user=user, session_id=session_id, ) @@ -641,6 +663,13 @@ async def send_async( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -667,7 +696,6 @@ async def send_async( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -693,6 +721,8 @@ async def send_async( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -704,7 +734,6 @@ async def send_async( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -754,6 +783,13 @@ async def send_async( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -780,7 +816,6 @@ async def send_async( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -806,6 +841,8 @@ async def send_async( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -817,7 +854,6 @@ async def send_async( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -866,6 +902,13 @@ async def send_async( temperature: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET, top_k: Optional[float] = None, + image_config: Optional[ + Union[ + Dict[str, components.OpenResponsesRequestImageConfig], + Dict[str, components.OpenResponsesRequestImageConfigTypedDict], + ] + ] = None, + modalities: Optional[List[components.ResponsesOutputModality]] = None, prompt_cache_key: OptionalNullable[str] = UNSET, previous_response_id: OptionalNullable[str] = UNSET, prompt: OptionalNullable[ @@ -892,7 +935,6 @@ async def send_async( List[components.OpenResponsesRequestPluginUnionTypedDict], ] ] = None, - route: OptionalNullable[components.OpenResponsesRequestRoute] = UNSET, user: Optional[str] = None, session_id: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, @@ -918,6 +960,8 @@ async def send_async( :param temperature: :param top_p: :param top_k: + :param image_config: Provider-specific image configuration options. Keys and values vary by model/provider. See https://openrouter.ai/docs/features/multimodal/image-generation for more details. + :param modalities: Output modalities for the response. Supported values are \"text\" and \"image\". :param prompt_cache_key: :param previous_response_id: :param prompt: @@ -929,7 +973,6 @@ async def send_async( :param stream: :param provider: When multiple model providers are available, optionally indicate your routing preference. :param plugins: Plugins you want to enable for this request, including their settings. - :param route: Routing strategy for multiple models: \"fallback\" (default) uses secondary models as backups, \"sort\" sorts all endpoints together by routing criteria. :param user: A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. :param session_id: A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. :param retries: Override the default retry configuration for this method @@ -973,6 +1016,8 @@ async def send_async( temperature=temperature, top_p=top_p, top_k=top_k, + image_config=image_config, + modalities=modalities, prompt_cache_key=prompt_cache_key, previous_response_id=previous_response_id, prompt=utils.get_pydantic_model( @@ -990,7 +1035,6 @@ async def send_async( plugins=utils.get_pydantic_model( plugins, Optional[List[components.OpenResponsesRequestPluginUnion]] ), - route=route, user=user, session_id=session_id, ) diff --git a/uv.lock b/uv.lock index d506269..b70500b 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 2 requires-python = ">=3.9.2" resolution-markers = [ "python_full_version >= '3.12'", @@ -211,7 +211,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.0.16" +version = "0.0.17" source = { editable = "." } dependencies = [ { name = "httpcore" }, From e3361882cdf9124a5d75024cfaf33ac909885fec Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Fri, 9 Jan 2026 14:35:31 -0500 Subject: [PATCH 3/4] Project import generated by Copybara. GitOrigin-RevId: 0c3f0fb4be86f675ce6eca10edd2bd576c7d38d2 --- .speakeasy/gen.lock | 2 +- .speakeasy/in.openapi.yaml | 7 ++-- .speakeasy/out.openapi.yaml | 5 +-- docs/components/percentilestats.md | 2 +- docs/components/publicendpoint.md | 34 ++++++++++---------- src/openrouter/components/percentilestats.py | 4 +-- src/openrouter/components/publicendpoint.py | 4 +-- 7 files changed, 31 insertions(+), 27 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d262fc2..ba4152a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,7 +1,7 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: 772a7ec8092cfd6437e71806e7b19e28 + docChecksum: b8b957bd96c3c9aad725db9b7f3be39d docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 88a1282..0e33dd0 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -4699,7 +4699,9 @@ components: - p75 - p90 - p99 - description: Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. + description: >- + Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible + when authenticated with an API key or cookie; returns null for unauthenticated requests. PublicEndpoint: type: object properties: @@ -4774,7 +4776,8 @@ components: - $ref: '#/components/schemas/PercentileStats' - description: >- Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token - generation speed. + generation speed. Only visible when authenticated with an API key or cookie; returns null for + unauthenticated requests. required: - name - model_name diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c19e2c2..7f81f28 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -4701,7 +4701,8 @@ components: - p75 - p90 - p99 - description: Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. + description: >- + Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. PublicEndpoint: type: object properties: @@ -4775,7 +4776,7 @@ components: allOf: - $ref: '#/components/schemas/PercentileStats' - description: >- - Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. + Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. required: - name - model_name diff --git a/docs/components/percentilestats.md b/docs/components/percentilestats.md index db0cccb..6f47431 100644 --- a/docs/components/percentilestats.md +++ b/docs/components/percentilestats.md @@ -1,6 +1,6 @@ # PercentileStats -Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. +Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. ## Fields diff --git a/docs/components/publicendpoint.md b/docs/components/publicendpoint.md index bff4d4e..dac1698 100644 --- a/docs/components/publicendpoint.md +++ b/docs/components/publicendpoint.md @@ -5,20 +5,20 @@ Information about a specific model endpoint ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | | -| `model_name` | *str* | :heavy_check_mark: | N/A | | -| `context_length` | *float* | :heavy_check_mark: | N/A | | -| `pricing` | [components.Pricing](../components/pricing.md) | :heavy_check_mark: | N/A | | -| `provider_name` | [components.ProviderName](../components/providername.md) | :heavy_check_mark: | N/A | OpenAI | -| `tag` | *str* | :heavy_check_mark: | N/A | | -| `quantization` | [Nullable[components.PublicEndpointQuantization]](../components/publicendpointquantization.md) | :heavy_check_mark: | N/A | fp16 | -| `max_completion_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | | -| `max_prompt_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | | -| `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | N/A | | -| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 | -| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | -| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | -| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token. | | -| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | N/A | | +| `model_name` | *str* | :heavy_check_mark: | N/A | | +| `context_length` | *float* | :heavy_check_mark: | N/A | | +| `pricing` | [components.Pricing](../components/pricing.md) | :heavy_check_mark: | N/A | | +| `provider_name` | [components.ProviderName](../components/providername.md) | :heavy_check_mark: | N/A | OpenAI | +| `tag` | *str* | :heavy_check_mark: | N/A | | +| `quantization` | [Nullable[components.PublicEndpointQuantization]](../components/publicendpointquantization.md) | :heavy_check_mark: | N/A | fp16 | +| `max_completion_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | | +| `max_prompt_tokens` | *Nullable[float]* | :heavy_check_mark: | N/A | | +| `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | N/A | | +| `status` | [Optional[components.EndpointStatus]](../components/endpointstatus.md) | :heavy_minus_sign: | N/A | 0 | +| `uptime_last_30m` | *Nullable[float]* | :heavy_check_mark: | N/A | | +| `supports_implicit_caching` | *bool* | :heavy_check_mark: | N/A | | +| `latency_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. | | +| `throughput_last_30m` | [Nullable[components.PercentileStats]](../components/percentilestats.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/src/openrouter/components/percentilestats.py b/src/openrouter/components/percentilestats.py index 78f7e0b..e979e11 100644 --- a/src/openrouter/components/percentilestats.py +++ b/src/openrouter/components/percentilestats.py @@ -6,7 +6,7 @@ class PercentileStatsTypedDict(TypedDict): - r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" p50: float r"""Median (50th percentile)""" @@ -19,7 +19,7 @@ class PercentileStatsTypedDict(TypedDict): class PercentileStats(BaseModel): - r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" p50: float r"""Median (50th percentile)""" diff --git a/src/openrouter/components/publicendpoint.py b/src/openrouter/components/publicendpoint.py index bcf541e..22a4645 100644 --- a/src/openrouter/components/publicendpoint.py +++ b/src/openrouter/components/publicendpoint.py @@ -113,7 +113,7 @@ class PublicEndpointTypedDict(TypedDict): uptime_last_30m: Nullable[float] supports_implicit_caching: bool latency_last_30m: Nullable[PercentileStatsTypedDict] - r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" throughput_last_30m: Nullable[PercentileStatsTypedDict] status: NotRequired[EndpointStatus] @@ -150,7 +150,7 @@ class PublicEndpoint(BaseModel): supports_implicit_caching: bool latency_last_30m: Nullable[PercentileStats] - r"""Latency percentiles in seconds over the last 30 minutes. Latency measures time to first token.""" + r"""Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests.""" throughput_last_30m: Nullable[PercentileStats] From 5d804916ec1b76aac407768e82f5ad75579e3c1e Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Fri, 9 Jan 2026 21:25:28 +0000 Subject: [PATCH 4/4] Project import generated by Copybara. GitOrigin-RevId: 55335c8a1cc66e6e032e9075d6f6eea5d9fb9138 --- .speakeasy/gen.lock | 2 +- .speakeasy/in.openapi.yaml | 2 ++ .speakeasy/out.openapi.yaml | 2 ++ .speakeasy/workflow.lock | 10 +++++----- docs/components/providername.md | 1 + docs/components/schema0enum.md | 1 + src/openrouter/components/_schema0.py | 1 + src/openrouter/components/providername.py | 1 + 8 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ba4152a..3e22aef 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,7 +1,7 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: b8b957bd96c3c9aad725db9b7f3be39d + docChecksum: 7419f3b58a64f08efb375ead9e169446 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 0e33dd0..b978e35 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -3500,6 +3500,7 @@ components: - Groq - Hyperbolic - Inception + - Inceptron - InferenceNet - Infermatic - Inflection @@ -4975,6 +4976,7 @@ components: - Groq - Hyperbolic - Inception + - Inceptron - InferenceNet - Infermatic - Inflection diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 7f81f28..1796209 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3519,6 +3519,7 @@ components: - Groq - Hyperbolic - Inception + - Inceptron - InferenceNet - Infermatic - Inflection @@ -4974,6 +4975,7 @@ components: - Groq - Hyperbolic - Inception + - Inceptron - InferenceNet - Infermatic - Inflection diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 5cfa06b..0cea211 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -8,8 +8,8 @@ sources: - latest OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:fcc289022d99776aaf9434e14ccc3c9878a847384b300158c84391c9f4aed6ce - sourceBlobDigest: sha256:40c2ad7a48417d63a674f078aa75768dc7266885f38003ab3e5c00067d444fbe + sourceRevisionDigest: sha256:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e + sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98 tags: - latest - subtree-sync-import-python-sdk @@ -18,10 +18,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:fcc289022d99776aaf9434e14ccc3c9878a847384b300158c84391c9f4aed6ce - sourceBlobDigest: sha256:40c2ad7a48417d63a674f078aa75768dc7266885f38003ab3e5c00067d444fbe + sourceRevisionDigest: sha256:5615c05050362c0944a59e3b5b0437157f9d152faac1509d3c390bbc85e93b1e + sourceBlobDigest: sha256:4f08bbf0b65fd4e617996964ccb1fa33ed7e807f81d8731ba4d00b0a7fd2da98 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:567674342c32a59ace54f464472abd2784897dbbe9e4bb6f953480ea84e03cf9 + codeSamplesRevisionDigest: sha256:c60fe0121ecdbfb79af3a344b52b8daade826fb9648b925f229e5b1d93b5c7ac workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/docs/components/providername.md b/docs/components/providername.md index f4a2f7a..5b56801 100644 --- a/docs/components/providername.md +++ b/docs/components/providername.md @@ -36,6 +36,7 @@ | `GROQ` | Groq | | `HYPERBOLIC` | Hyperbolic | | `INCEPTION` | Inception | +| `INCEPTRON` | Inceptron | | `INFERENCE_NET` | InferenceNet | | `INFERMATIC` | Infermatic | | `INFLECTION` | Inflection | diff --git a/docs/components/schema0enum.md b/docs/components/schema0enum.md index d59e27a..f1c6708 100644 --- a/docs/components/schema0enum.md +++ b/docs/components/schema0enum.md @@ -36,6 +36,7 @@ | `GROQ` | Groq | | `HYPERBOLIC` | Hyperbolic | | `INCEPTION` | Inception | +| `INCEPTRON` | Inceptron | | `INFERENCE_NET` | InferenceNet | | `INFERMATIC` | Infermatic | | `INFLECTION` | Inflection | diff --git a/src/openrouter/components/_schema0.py b/src/openrouter/components/_schema0.py index fdc167b..4da27c8 100644 --- a/src/openrouter/components/_schema0.py +++ b/src/openrouter/components/_schema0.py @@ -41,6 +41,7 @@ "Groq", "Hyperbolic", "Inception", + "Inceptron", "InferenceNet", "Infermatic", "Inflection", diff --git a/src/openrouter/components/providername.py b/src/openrouter/components/providername.py index 8a04187..e9c1402 100644 --- a/src/openrouter/components/providername.py +++ b/src/openrouter/components/providername.py @@ -38,6 +38,7 @@ "Groq", "Hyperbolic", "Inception", + "Inceptron", "InferenceNet", "Infermatic", "Inflection",