This commit is contained in:
Matt Apperson
2025-12-04 13:07:01 -05:00
parent 06b2ccc54a
commit aed8199b2b
65 changed files with 518 additions and 765 deletions
+30 -33
View File
@@ -1,12 +1,12 @@
lockVersion: 2.0.0 lockVersion: 2.0.0
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
management: management:
docChecksum: 7c3a22e3f6b8d7c91ff063e2951aed2f docChecksum: bcccd1abd05f6654a822386f2eefbd8a
docVersion: 1.0.0 docVersion: 1.0.0
speakeasyVersion: 1.666.0 speakeasyVersion: 1.666.0
generationVersion: 2.768.0 generationVersion: 2.768.0
releaseVersion: 0.1.1 releaseVersion: 0.0.16
configChecksum: 1206f35a1f0802441ea1b8674cd04f00 configChecksum: cd00e781b0ef78cfcb3fe812f51e93ff
repoURL: https://github.com/OpenRouterTeam/python-sdk.git repoURL: https://github.com/OpenRouterTeam/python-sdk.git
installationURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git
published: true published: true
@@ -66,14 +66,16 @@ generatedFiles:
- docs/components/chatgenerationtokenusage.md - docs/components/chatgenerationtokenusage.md
- docs/components/chatmessagecontentitem.md - docs/components/chatmessagecontentitem.md
- docs/components/chatmessagecontentitemaudio.md - docs/components/chatmessagecontentitemaudio.md
- docs/components/chatmessagecontentitemaudioformat.md
- docs/components/chatmessagecontentitemaudioinputaudio.md - docs/components/chatmessagecontentitemaudioinputaudio.md
- docs/components/chatmessagecontentitemcachecontrol.md - docs/components/chatmessagecontentitemfile.md
- docs/components/chatmessagecontentitemimage.md - docs/components/chatmessagecontentitemimage.md
- docs/components/chatmessagecontentitemimagedetail.md - docs/components/chatmessagecontentitemimagedetail.md
- docs/components/chatmessagecontentitemtext.md - docs/components/chatmessagecontentitemtext.md
- docs/components/chatmessagecontentitemvideo.md - docs/components/chatmessagecontentitemvideo.md
- docs/components/chatmessagecontentitemvideoinputvideo.md - docs/components/chatmessagecontentitemvideoinputvideo.md
- docs/components/chatmessagecontentitemvideovideourl.md - docs/components/chatmessagecontentitemvideovideourl.md
- docs/components/chatmessagecontentitemvideovideourlvideourl.md
- docs/components/chatmessagetokenlogprob.md - docs/components/chatmessagetokenlogprob.md
- docs/components/chatmessagetokenlogprobs.md - docs/components/chatmessagetokenlogprobs.md
- docs/components/chatmessagetoolcall.md - docs/components/chatmessagetoolcall.md
@@ -106,12 +108,12 @@ generatedFiles:
- docs/components/costdetails.md - docs/components/costdetails.md
- docs/components/createchargerequest.md - docs/components/createchargerequest.md
- docs/components/datacollection.md - docs/components/datacollection.md
- docs/components/debug.md
- docs/components/defaultparameters.md - docs/components/defaultparameters.md
- docs/components/edgenetworktimeoutresponseerrordata.md - docs/components/edgenetworktimeoutresponseerrordata.md
- docs/components/effort.md - docs/components/effort.md
- docs/components/endpointstatus.md - docs/components/endpointstatus.md
- docs/components/engine.md - docs/components/engine.md
- docs/components/file.md
- docs/components/filecitation.md - docs/components/filecitation.md
- docs/components/filecitationtype.md - docs/components/filecitationtype.md
- docs/components/filepath.md - docs/components/filepath.md
@@ -119,7 +121,6 @@ generatedFiles:
- docs/components/forbiddenresponseerrordata.md - docs/components/forbiddenresponseerrordata.md
- docs/components/idfileparser.md - docs/components/idfileparser.md
- docs/components/idmoderation.md - docs/components/idmoderation.md
- docs/components/idresponsehealing.md
- docs/components/idweb.md - docs/components/idweb.md
- docs/components/ignore.md - docs/components/ignore.md
- docs/components/imagegenerationstatus.md - docs/components/imagegenerationstatus.md
@@ -303,7 +304,6 @@ generatedFiles:
- docs/components/plugin.md - docs/components/plugin.md
- docs/components/pluginfileparser.md - docs/components/pluginfileparser.md
- docs/components/pluginmoderation.md - docs/components/pluginmoderation.md
- docs/components/pluginresponsehealing.md
- docs/components/pluginweb.md - docs/components/pluginweb.md
- docs/components/pricing.md - docs/components/pricing.md
- docs/components/prompt.md - docs/components/prompt.md
@@ -395,7 +395,6 @@ generatedFiles:
- docs/components/toplogprob.md - docs/components/toplogprob.md
- docs/components/topproviderinfo.md - docs/components/topproviderinfo.md
- docs/components/truncation.md - docs/components/truncation.md
- docs/components/ttl.md
- docs/components/type.md - docs/components/type.md
- docs/components/typeresponsecompleted.md - docs/components/typeresponsecompleted.md
- docs/components/typeresponsecontentpartadded.md - docs/components/typeresponsecontentpartadded.md
@@ -421,8 +420,7 @@ generatedFiles:
- docs/components/usermessage.md - docs/components/usermessage.md
- docs/components/usermessagecontent.md - docs/components/usermessagecontent.md
- docs/components/variables.md - docs/components/variables.md
- docs/components/videourl1.md - docs/components/videourl.md
- docs/components/videourl2.md
- docs/components/websearchpreviewtooluserlocation.md - docs/components/websearchpreviewtooluserlocation.md
- docs/components/websearchpreviewtooluserlocationtype.md - docs/components/websearchpreviewtooluserlocationtype.md
- docs/components/websearchstatus.md - docs/components/websearchstatus.md
@@ -459,6 +457,7 @@ generatedFiles:
- docs/operations/createembeddingsprovider.md - docs/operations/createembeddingsprovider.md
- docs/operations/createembeddingsrequest.md - docs/operations/createembeddingsrequest.md
- docs/operations/createembeddingsresponse.md - docs/operations/createembeddingsresponse.md
- docs/operations/createembeddingsresponsebody.md
- docs/operations/createkeysdata.md - docs/operations/createkeysdata.md
- docs/operations/createkeyslimitreset.md - docs/operations/createkeyslimitreset.md
- docs/operations/createkeysrequest.md - docs/operations/createkeysrequest.md
@@ -472,7 +471,6 @@ generatedFiles:
- docs/operations/exchangeauthcodeforapikeycodechallengemethod.md - docs/operations/exchangeauthcodeforapikeycodechallengemethod.md
- docs/operations/exchangeauthcodeforapikeyrequest.md - docs/operations/exchangeauthcodeforapikeyrequest.md
- docs/operations/exchangeauthcodeforapikeyresponse.md - docs/operations/exchangeauthcodeforapikeyresponse.md
- docs/operations/getcreditsdata.md
- docs/operations/getcreditsresponse.md - docs/operations/getcreditsresponse.md
- docs/operations/getcurrentkeydata.md - docs/operations/getcurrentkeydata.md
- docs/operations/getcurrentkeyresponse.md - docs/operations/getcurrentkeyresponse.md
@@ -555,13 +553,12 @@ generatedFiles:
- src/openrouter/components/assistantmessage.py - src/openrouter/components/assistantmessage.py
- src/openrouter/components/badgatewayresponseerrordata.py - src/openrouter/components/badgatewayresponseerrordata.py
- src/openrouter/components/badrequestresponseerrordata.py - src/openrouter/components/badrequestresponseerrordata.py
- src/openrouter/components/chatcompletionfinishreason.py
- src/openrouter/components/chaterror.py - src/openrouter/components/chaterror.py
- src/openrouter/components/chatgenerationparams.py - src/openrouter/components/chatgenerationparams.py
- src/openrouter/components/chatgenerationtokenusage.py - src/openrouter/components/chatgenerationtokenusage.py
- src/openrouter/components/chatmessagecontentitem.py - src/openrouter/components/chatmessagecontentitem.py
- src/openrouter/components/chatmessagecontentitemaudio.py - src/openrouter/components/chatmessagecontentitemaudio.py
- src/openrouter/components/chatmessagecontentitemcachecontrol.py - src/openrouter/components/chatmessagecontentitemfile.py
- src/openrouter/components/chatmessagecontentitemimage.py - src/openrouter/components/chatmessagecontentitemimage.py
- src/openrouter/components/chatmessagecontentitemtext.py - src/openrouter/components/chatmessagecontentitemtext.py
- src/openrouter/components/chatmessagecontentitemvideo.py - src/openrouter/components/chatmessagecontentitemvideo.py
@@ -570,7 +567,6 @@ generatedFiles:
- src/openrouter/components/chatmessagetoolcall.py - src/openrouter/components/chatmessagetoolcall.py
- src/openrouter/components/chatresponse.py - src/openrouter/components/chatresponse.py
- src/openrouter/components/chatresponsechoice.py - src/openrouter/components/chatresponsechoice.py
- src/openrouter/components/chatstreamingchoice.py
- src/openrouter/components/chatstreamingmessagechunk.py - src/openrouter/components/chatstreamingmessagechunk.py
- src/openrouter/components/chatstreamingmessagetoolcall.py - src/openrouter/components/chatstreamingmessagetoolcall.py
- src/openrouter/components/chatstreamingresponsechunk.py - src/openrouter/components/chatstreamingresponsechunk.py
@@ -693,6 +689,7 @@ generatedFiles:
- src/openrouter/components/unprocessableentityresponseerrordata.py - src/openrouter/components/unprocessableentityresponseerrordata.py
- src/openrouter/components/urlcitation.py - src/openrouter/components/urlcitation.py
- src/openrouter/components/usermessage.py - src/openrouter/components/usermessage.py
- src/openrouter/components/videourl.py
- src/openrouter/components/websearchpreviewtooluserlocation.py - src/openrouter/components/websearchpreviewtooluserlocation.py
- src/openrouter/components/websearchstatus.py - src/openrouter/components/websearchstatus.py
- src/openrouter/credits.py - src/openrouter/credits.py
@@ -776,10 +773,10 @@ examples:
createResponses: createResponses:
speakeasy-default-create-responses: speakeasy-default-create-responses:
requestBody: requestBody:
application/json: {"input": [{"type": "message", "role": "user", "content": "Hello, how are you?"}], "tools": [{"type": "function", "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}}}], "model": "anthropic/claude-4.5-sonnet-20250929", "temperature": 0.7, "top_p": 0.9, "store": false, "service_tier": "auto", "stream": false} application/json: {"stream": false}
responses: responses:
"200": "200":
application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "status": "completed", "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "status": "completed", "content": [{"type": "output_text", "text": "Hello! How can I help you today?", "annotations": []}]}], "error": null, "incomplete_details": null, "usage": {"input_tokens": 10, "input_tokens_details": {"cached_tokens": 0}, "output_tokens": 25, "output_tokens_details": {"reasoning_tokens": 0}, "total_tokens": 35}, "max_output_tokens": null, "temperature": null, "top_p": null, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true} application/json: {"id": "resp-abc123", "object": "response", "created_at": 1704067200, "model": "gpt-4", "output": [{"id": "msg-abc123", "role": "assistant", "type": "message", "content": [{"type": "output_text", "text": "Hello! How can I help you today?"}]}], "error": null, "incomplete_details": null, "temperature": null, "top_p": null, "instructions": null, "metadata": null, "tools": [], "tool_choice": "auto", "parallel_tool_calls": true}
"400": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401": "401":
@@ -826,7 +823,7 @@ examples:
speakeasy-default-get-credits: speakeasy-default-get-credits:
responses: responses:
"200": "200":
application/json: {"data": {"total_credits": 100.5, "total_usage": 25.75}} application/json: {}
"401": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"403": "403":
@@ -851,7 +848,7 @@ examples:
createEmbeddings: createEmbeddings:
speakeasy-default-create-embeddings: speakeasy-default-create-embeddings:
requestBody: requestBody:
application/json: {"input": "<value>", "model": "Taurus", "provider": {"data_collection": "allow", "zdr": true, "enforce_distillable_text": true, "order": ["OpenAI"], "only": ["OpenAI"], "ignore": ["OpenAI"], "quantizations": ["fp16"], "sort": "price"}} application/json: {"input": "<value>", "model": "Taurus"}
responses: responses:
"200": "200":
application/json: {"object": "list", "data": [], "model": "Land Cruiser"} application/json: {"object": "list", "data": [], "model": "Land Cruiser"}
@@ -880,7 +877,7 @@ examples:
speakeasy-default-list-embeddings-models: speakeasy-default-list-embeddings-models:
responses: responses:
"200": "200":
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "pricing": {"prompt": "0.00003", "completion": "0.00006", "request": "0", "image": "0"}, "context_length": 8192, "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"context_length": 8192, "max_completion_tokens": 4096, "is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]} application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
"400": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"500": "500":
@@ -920,7 +917,7 @@ examples:
speakeasy-default-get-models: speakeasy-default-get-models:
responses: responses:
"200": "200":
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "pricing": {"prompt": "0.00003", "completion": "0.00006", "request": "0", "image": "0"}, "context_length": 8192, "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"context_length": 8192, "max_completion_tokens": 4096, "is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]} application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
"400": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"500": "500":
@@ -929,7 +926,7 @@ examples:
speakeasy-default-list-models-user: speakeasy-default-list-models-user:
responses: responses:
"200": "200":
application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "pricing": {"prompt": "0.00003", "completion": "0.00006", "request": "0", "image": "0"}, "context_length": 8192, "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"context_length": 8192, "max_completion_tokens": 4096, "is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]} application/json: {"data": [{"id": "openai/gpt-4", "canonical_slug": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "context_length": 8192, "architecture": {"modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "top_provider": {"is_moderated": true}, "per_request_limits": null, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "default_parameters": null}]}
"401": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"500": "500":
@@ -942,7 +939,7 @@ examples:
slug: "<value>" slug: "<value>"
responses: responses:
"200": "200":
application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006", "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": -3, "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}]}}
"404": "404":
application/json: {"error": {"code": 404, "message": "Resource not found"}} application/json: {"error": {"code": 404, "message": "Resource not found"}}
"500": "500":
@@ -951,7 +948,7 @@ examples:
speakeasy-default-list-endpoints-zdr: speakeasy-default-list-endpoints-zdr:
responses: responses:
"200": "200":
application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006", "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"], "status": 0, "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}]}
"500": "500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}} application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
getParameters: getParameters:
@@ -973,7 +970,7 @@ examples:
speakeasy-default-list-providers: speakeasy-default-list-providers:
responses: responses:
"200": "200":
application/json: {"data": [{"name": "OpenAI", "slug": "openai", "privacy_policy_url": "https://openai.com/privacy", "terms_of_service_url": "https://openai.com/terms", "status_page_url": "https://status.openai.com"}]} application/json: {"data": [{"name": "OpenAI", "slug": "openai", "privacy_policy_url": "https://openai.com/privacy"}]}
"500": "500":
application/json: {"error": {"code": 500, "message": "Internal Server Error"}} application/json: {"error": {"code": 500, "message": "Internal Server Error"}}
list: list:
@@ -984,7 +981,7 @@ examples:
offset: "0" offset: "0"
responses: responses:
"200": "200":
application/json: {"data": [{"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z", "expires_at": "2027-12-31T23:59:59Z"}]} application/json: {"data": [{"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}]}
"401": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"429": "429":
@@ -994,10 +991,10 @@ examples:
createKeys: createKeys:
speakeasy-default-create-keys: speakeasy-default-create-keys:
requestBody: requestBody:
application/json: {"name": "My New API Key", "limit": 50, "limit_reset": "monthly", "include_byok_in_limit": true, "expires_at": "2027-12-31T23:59:59Z"} application/json: {"name": "My New API Key"}
responses: responses:
"201": "201":
application/json: {"data": {"hash": "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", "name": "My New API Key", "label": "My New API Key", "disabled": false, "limit": 50, "limit_remaining": 50, "limit_reset": "monthly", "include_byok_in_limit": true, "usage": 0, "usage_daily": 0, "usage_weekly": 0, "usage_monthly": 0, "byok_usage": 0, "byok_usage_daily": 0, "byok_usage_weekly": 0, "byok_usage_monthly": 0, "created_at": "2025-08-24T10:30:00Z", "updated_at": null, "expires_at": "2027-12-31T23:59:59Z"}, "key": "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"} application/json: {"data": {"hash": "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", "name": "My New API Key", "label": "My New API Key", "disabled": false, "limit": 50, "limit_remaining": 50, "limit_reset": "monthly", "include_byok_in_limit": true, "usage": 0, "usage_daily": 0, "usage_weekly": 0, "usage_monthly": 0, "byok_usage": 0, "byok_usage_daily": 0, "byok_usage_weekly": 0, "byok_usage_monthly": 0, "created_at": "2025-08-24T10:30:00Z", "updated_at": null}, "key": "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"}
"400": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401": "401":
@@ -1012,10 +1009,10 @@ examples:
path: path:
hash: "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" hash: "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"
requestBody: requestBody:
application/json: {"name": "Updated API Key Name", "disabled": false, "limit": 75, "limit_reset": "daily", "include_byok_in_limit": true} application/json: {}
responses: responses:
"200": "200":
application/json: {"data": {"hash": "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", "name": "Updated API Key Name", "label": "Updated API Key Name", "disabled": false, "limit": 75, "limit_remaining": 49.5, "limit_reset": "daily", "include_byok_in_limit": true, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T16:00:00Z", "expires_at": null}} application/json: {"data": {"hash": "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", "name": "Updated API Key Name", "label": "Updated API Key Name", "disabled": false, "limit": 75, "limit_remaining": 49.5, "limit_reset": "daily", "include_byok_in_limit": true, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T16:00:00Z"}}
"400": "400":
application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} application/json: {"error": {"code": 400, "message": "Invalid request parameters"}}
"401": "401":
@@ -1049,7 +1046,7 @@ examples:
hash: "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" hash: "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"
responses: responses:
"200": "200":
application/json: {"data": {"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z", "expires_at": "2027-12-31T23:59:59Z"}} application/json: {"data": {"hash": "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", "name": "My Production Key", "label": "Production API Key", "disabled": false, "limit": 100, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "created_at": "2025-08-24T10:30:00Z", "updated_at": "2025-08-24T15:45:00Z"}}
"401": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"404": "404":
@@ -1062,7 +1059,7 @@ examples:
speakeasy-default-get-current-key: speakeasy-default-get-current-key:
responses: responses:
"200": "200":
application/json: {"data": {"label": "sk-or-v1-au78b3456789012345678901234567890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "expires_at": "2027-12-31T23:59:59Z", "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}} application/json: {"data": {"label": "sk-or-v1-au78b3456789012345678901234567890", "limit": 100, "usage": 25.5, "usage_daily": 25.5, "usage_weekly": 25.5, "usage_monthly": 25.5, "byok_usage": 17.38, "byok_usage_daily": 17.38, "byok_usage_weekly": 17.38, "byok_usage_monthly": 17.38, "is_free_tier": false, "is_provisioning_key": false, "limit_remaining": 74.5, "limit_reset": "monthly", "include_byok_in_limit": false, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}}
"401": "401":
application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} application/json: {"error": {"code": 401, "message": "Missing Authentication header"}}
"500": "500":
@@ -1070,7 +1067,7 @@ examples:
exchangeAuthCodeForAPIKey: exchangeAuthCodeForAPIKey:
speakeasy-default-exchange-auth-code-for-API-key: speakeasy-default-exchange-auth-code-for-API-key:
requestBody: requestBody:
application/json: {"code": "auth_code_abc123def456", "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk", "code_challenge_method": "S256"} application/json: {"code": "auth_code_abc123def456"}
responses: responses:
"200": "200":
application/json: {"key": "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", "user_id": "user_2yOPcMpKoQhcd4bVgSMlELRaIah"} application/json: {"key": "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", "user_id": "user_2yOPcMpKoQhcd4bVgSMlELRaIah"}
@@ -1083,7 +1080,7 @@ examples:
createAuthKeysCode: createAuthKeysCode:
speakeasy-default-create-auth-keys-code: speakeasy-default-create-auth-keys-code:
requestBody: requestBody:
application/json: {"callback_url": "https://myapp.com/auth/callback", "code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", "code_challenge_method": "S256", "limit": 100} application/json: {"callback_url": "https://myapp.com/auth/callback"}
responses: responses:
"200": "200":
application/json: {"data": {"id": "auth_code_xyz789", "app_id": 12345, "created_at": "2025-08-24T10:30:00Z"}} application/json: {"data": {"id": "auth_code_xyz789", "app_id": 12345, "created_at": "2025-08-24T10:30:00Z"}}
+7 -5
View File
@@ -6,7 +6,7 @@ generation:
sdkClassName: OpenRouter sdkClassName: OpenRouter
maintainOpenAPIOrder: true maintainOpenAPIOrder: true
usageSnippets: usageSnippets:
optionalPropertyRendering: withExample optionalPropertyRendering: never
sdkInitStyle: constructor sdkInitStyle: constructor
useClassNamesForArrayFields: true useClassNamesForArrayFields: true
fixes: fixes:
@@ -24,13 +24,14 @@ generation:
sdkHooksConfigAccess: true sdkHooksConfigAccess: true
schemas: schemas:
allOfMergeStrategy: shallowMerge allOfMergeStrategy: shallowMerge
requestBodyFieldName: body requestBodyFieldName: ""
tests: tests:
generateTests: false generateTests: false
generateNewTests: true generateNewTests: true
skipResponseBodyAssertions: false skipResponseBodyAssertions: false
preApplyUnionDiscriminators: true
python: python:
version: 0.1.1 version: 0.0.16
additionalDependencies: additionalDependencies:
dev: {} dev: {}
main: {} main: {}
@@ -57,11 +58,12 @@ python:
imports: imports:
option: openapi option: openapi
paths: paths:
callbacks: "" callbacks: callbacks
errors: errors errors: errors
operations: operations operations: operations
shared: components shared: components
webhooks: "" webhooks: webhooks
inferSSEOverload: true
inferUnionDiscriminators: true inferUnionDiscriminators: true
inputModelSuffix: input inputModelSuffix: input
legacyPyright: false legacyPyright: false
+69 -95
View File
@@ -3464,14 +3464,12 @@ components:
- AionLabs - AionLabs
- Alibaba - Alibaba
- Amazon Bedrock - Amazon Bedrock
- Amazon Nova
- Anthropic - Anthropic
- Arcee AI - Arcee
- AtlasCloud - AtlasCloud
- Avian - Avian
- Azure - Azure
- BaseTen - BaseTen
- BytePlus
- Black Forest Labs - Black Forest Labs
- Cerebras - Cerebras
- Chutes - Chutes
@@ -3486,7 +3484,6 @@ components:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
@@ -3517,7 +3514,6 @@ components:
- SambaNova - SambaNova
- SiliconFlow - SiliconFlow
- Stealth - Stealth
- StreamLake
- Switchpoint - Switchpoint
- Targon - Targon
- Together - Together
@@ -3652,13 +3648,18 @@ components:
nullable: true nullable: true
store: store:
type: boolean type: boolean
const: false nullable: true
default: false
service_tier: service_tier:
type: string allOf:
enum: - $ref: '#/components/schemas/OpenAIResponsesServiceTier'
- auto - enum:
default: auto - auto
- default
- flex
- scale
- priority
example: auto
x-speakeasy-unknown-values: allow
truncation: truncation:
allOf: allOf:
- $ref: '#/components/schemas/OpenAIResponsesTruncation' - $ref: '#/components/schemas/OpenAIResponsesTruncation'
@@ -3802,14 +3803,6 @@ components:
x-speakeasy-unknown-values: allow x-speakeasy-unknown-values: allow
required: required:
- id - id
- type: object
properties:
id:
type: string
enum:
- response-healing
required:
- id
description: Plugins you want to enable for this request, including their settings. description: Plugins you want to enable for this request, including their settings.
user: user:
type: string type: string
@@ -4604,10 +4597,6 @@ components:
status: default status: default
uptime_last_30m: 99.5 uptime_last_30m: 99.5
supports_implicit_caching: true supports_implicit_caching: true
__schema0:
anyOf:
- $ref: '#/components/schemas/ChatCompletionFinishReason'
- type: 'null'
ModelName: ModelName:
type: string type: string
ChatMessageContentItemText: ChatMessageContentItemText:
@@ -4618,8 +4607,6 @@ components:
const: text const: text
text: text:
type: string type: string
cache_control:
$ref: '#/components/schemas/ChatMessageContentItemCacheControl'
required: required:
- type - type
- text - text
@@ -4659,6 +4646,15 @@ components:
type: string type: string
format: format:
type: string type: string
enum:
- wav
- mp3
- flac
- m4a
- ogg
- pcm16
- pcm24
x-speakeasy-unknown-values: allow
required: required:
- data - data
- format - format
@@ -4673,12 +4669,7 @@ components:
type: string type: string
const: input_video const: input_video
video_url: video_url:
type: object $ref: '#/components/schemas/VideoURL'
properties:
url:
type: string
required:
- url
required: required:
- type - type
- video_url - video_url
@@ -4698,12 +4689,40 @@ components:
- type - type
- video_url - video_url
type: object type: object
VideoURL:
type: object
properties:
url:
type: string
required:
- url
ChatMessageContentItemFile:
type: object
properties:
type:
type: string
const: file
file:
type: object
properties:
file_data:
type: string
file_id:
type: string
filename:
type: string
required:
- file_data
required:
- type
- file
ChatMessageContentItem: ChatMessageContentItem:
oneOf: oneOf:
- $ref: '#/components/schemas/ChatMessageContentItemText' - $ref: '#/components/schemas/ChatMessageContentItemText'
- $ref: '#/components/schemas/ChatMessageContentItemImage' - $ref: '#/components/schemas/ChatMessageContentItemImage'
- $ref: '#/components/schemas/ChatMessageContentItemAudio' - $ref: '#/components/schemas/ChatMessageContentItemAudio'
- $ref: '#/components/schemas/ChatMessageContentItemVideo' - $ref: '#/components/schemas/ChatMessageContentItemVideo'
- $ref: '#/components/schemas/ChatMessageContentItemFile'
type: object type: object
discriminator: discriminator:
propertyName: type propertyName: type
@@ -4713,6 +4732,7 @@ components:
input_audio: '#/components/schemas/ChatMessageContentItemAudio' input_audio: '#/components/schemas/ChatMessageContentItemAudio'
input_video: '#/components/schemas/ChatMessageContentItemVideo' input_video: '#/components/schemas/ChatMessageContentItemVideo'
video_url: '#/components/schemas/ChatMessageContentItemVideo' video_url: '#/components/schemas/ChatMessageContentItemVideo'
file: '#/components/schemas/ChatMessageContentItemFile'
ChatMessageToolCall: ChatMessageToolCall:
type: object type: object
properties: properties:
@@ -4836,14 +4856,16 @@ components:
- prompt_tokens - prompt_tokens
- total_tokens - total_tokens
ChatCompletionFinishReason: ChatCompletionFinishReason:
type: string anyOf:
enum: - type: string
- tool_calls enum:
- stop - tool_calls
- length - stop
- content_filter - length
- error - content_filter
x-speakeasy-unknown-values: allow - error
x-speakeasy-unknown-values: allow
- type: 'null'
JSONSchemaConfig: JSONSchemaConfig:
type: object type: object
properties: properties:
@@ -4885,20 +4907,6 @@ components:
required: required:
- type - type
- grammar - grammar
ChatMessageContentItemCacheControl:
type: object
properties:
type:
type: string
const: ephemeral
ttl:
type: string
enum:
- 5m
- 1h
x-speakeasy-unknown-values: allow
required:
- type
SystemMessage: SystemMessage:
type: object type: object
properties: properties:
@@ -5210,18 +5218,13 @@ components:
- type: 'null' - type: 'null'
user: user:
type: string type: string
debug:
type: object
properties:
echo_upstream_body:
type: boolean
required: required:
- messages - messages
ChatResponseChoice: ChatResponseChoice:
type: object type: object
properties: properties:
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema0' $ref: '#/components/schemas/ChatCompletionFinishReason'
index: index:
type: number type: number
message: message:
@@ -5282,7 +5285,7 @@ components:
delta: delta:
$ref: '#/components/schemas/ChatStreamingMessageChunk' $ref: '#/components/schemas/ChatStreamingMessageChunk'
finish_reason: finish_reason:
$ref: '#/components/schemas/__schema0' $ref: '#/components/schemas/ChatCompletionFinishReason'
index: index:
type: number type: number
logprobs: logprobs:
@@ -5615,12 +5618,6 @@ components:
- type: 'null' - type: 'null'
finish_reason: finish_reason:
$ref: '#/components/schemas/CompletionFinishReason' $ref: '#/components/schemas/CompletionFinishReason'
native_finish_reason:
type: string
reasoning:
anyOf:
- type: string
- type: 'null'
required: required:
- text - text
- index - index
@@ -5638,8 +5635,6 @@ components:
type: number type: number
model: model:
type: string type: string
provider:
type: string
system_fingerprint: system_fingerprint:
type: string type: string
choices: choices:
@@ -5858,26 +5853,6 @@ paths:
application/json: application/json:
schema: schema:
type: object type: object
properties:
data:
type: object
properties:
total_credits:
type: number
description: Total credits purchased
example: 100.5
total_usage:
type: number
description: Total credits used
example: 25.75
required:
- total_credits
- total_usage
example:
total_credits: 100.5
total_usage: 25.75
required:
- data
description: Total credits purchased and used description: Total credits purchased and used
example: example:
data: data:
@@ -6242,6 +6217,11 @@ paths:
- object - object
- data - data
- model - model
text/event-stream:
schema:
type: string
description: Not used for embeddings - embeddings do not support streaming
x-speakeasy-sse-sentinel: '[DONE]'
'400': '400':
description: Bad Request - Invalid request parameters or malformed input description: Bad Request - Invalid request parameters or malformed input
content: content:
@@ -6774,14 +6754,12 @@ paths:
- AionLabs - AionLabs
- Alibaba - Alibaba
- Amazon Bedrock - Amazon Bedrock
- Amazon Nova
- Anthropic - Anthropic
- Arcee AI - Arcee
- AtlasCloud - AtlasCloud
- Avian - Avian
- Azure - Azure
- BaseTen - BaseTen
- BytePlus
- Black Forest Labs - Black Forest Labs
- Cerebras - Cerebras
- Chutes - Chutes
@@ -6796,7 +6774,6 @@ paths:
- Fireworks - Fireworks
- Friendli - Friendli
- GMICloud - GMICloud
- GoPomelo
- Google - Google
- Google AI Studio - Google AI Studio
- Groq - Groq
@@ -6827,7 +6804,6 @@ paths:
- SambaNova - SambaNova
- SiliconFlow - SiliconFlow
- Stealth - Stealth
- StreamLake
- Switchpoint - Switchpoint
- Targon - Targon
- Together - Together
@@ -8437,5 +8413,3 @@ x-speakeasy-globals:
parameters: parameters:
- $ref: "#/components/parameters/AppIdentifier" - $ref: "#/components/parameters/AppIdentifier"
- $ref: "#/components/parameters/AppDisplayName" - $ref: "#/components/parameters/AppDisplayName"
- $ref: "#/components/parameters/AppIdentifier"
- $ref: "#/components/parameters/AppDisplayName"
+2 -110
View File
@@ -9,61 +9,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.beta.responses.send(input=[ res = open_router.beta.responses.send(stream=False)
{
"type": "message",
"role": "user",
"content": "Hello, how are you?",
},
], metadata={
"user_id": "123",
"session_id": "abc-def-ghi",
}, tools=[
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
},
},
},
},
], model="anthropic/claude-4.5-sonnet-20250929", text={
"format_": {
"type": "text",
},
"verbosity": "medium",
}, reasoning={
"summary": "auto",
"enabled": True,
}, temperature=0.7, top_p=0.9, prompt={
"id": "<id>",
"variables": {
"key": {
"type": "input_text",
"text": "Hello, how can I help you?",
},
},
}, service_tier="auto", truncation="auto", stream=False, provider={
"data_collection": "allow",
"zdr": True,
"enforce_distillable_text": True,
"order": [
"OpenAI",
],
"only": [
"OpenAI",
],
"ignore": [
"OpenAI",
],
"quantizations": None,
"sort": "price",
})
with res as event_stream: with res as event_stream:
for event in event_stream: for event in event_stream:
@@ -87,61 +33,7 @@ async def main():
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = await open_router.beta.responses.send_async(input=[ res = await open_router.beta.responses.send_async(stream=False)
{
"type": "message",
"role": "user",
"content": "Hello, how are you?",
},
], metadata={
"user_id": "123",
"session_id": "abc-def-ghi",
}, tools=[
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
},
},
},
},
], model="anthropic/claude-4.5-sonnet-20250929", text={
"format_": {
"type": "text",
},
"verbosity": "medium",
}, reasoning={
"summary": "auto",
"enabled": True,
}, temperature=0.7, top_p=0.9, prompt={
"id": "<id>",
"variables": {
"key": {
"type": "input_text",
"text": "Hello, how can I help you?",
},
},
}, service_tier="auto", truncation="auto", stream=False, provider={
"data_collection": "allow",
"zdr": True,
"enforce_distillable_text": True,
"order": [
"OpenAI",
],
"only": [
"OpenAI",
],
"ignore": [
"OpenAI",
],
"quantizations": None,
"sort": "price",
})
async with res as event_stream: async with res as event_stream:
async for event in event_stream: async for event in event_stream:
+1 -2
View File
@@ -26,5 +26,4 @@
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A | | `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
| `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `tools` | List[[components.ToolDefinitionJSON](../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../components/debug.md) | :heavy_minus_sign: | N/A |
@@ -33,3 +33,9 @@ value: components.ChatMessageContentItemVideo = /* values here */
value: components.ChatMessageContentItemVideo = /* values here */ value: components.ChatMessageContentItemVideo = /* values here */
``` ```
### `components.ChatMessageContentItemFile`
```python
value: components.ChatMessageContentItemFile = /* values here */
```
@@ -0,0 +1,14 @@
# ChatMessageContentItemAudioFormat
## Values
| Name | Value |
| ------- | ------- |
| `WAV` | wav |
| `MP3` | mp3 |
| `FLAC` | flac |
| `M4A` | m4a |
| `OGG` | ogg |
| `PCM16` | pcm16 |
| `PCM24` | pcm24 |
@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ | | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `data` | *str* | :heavy_check_mark: | N/A | | `data` | *str* | :heavy_check_mark: | N/A |
| `format_` | *str* | :heavy_check_mark: | N/A | | `format_` | [components.ChatMessageContentItemAudioFormat](../components/chatmessagecontentitemaudioformat.md) | :heavy_check_mark: | N/A |
@@ -1,9 +0,0 @@
# ChatMessageContentItemCacheControl
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| `type` | *Literal["ephemeral"]* | :heavy_check_mark: | N/A |
| `ttl` | [Optional[components.TTL]](../components/ttl.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,9 @@
# ChatMessageContentItemFile
## Fields
| Field | Type | Required | Description |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `type` | *Literal["file"]* | :heavy_check_mark: | N/A |
| `file` | [components.File](../components/file.md) | :heavy_check_mark: | N/A |
@@ -3,8 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | ------------------ | ------------------ | ------------------ | ------------------ |
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A | | `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
| `text` | *str* | :heavy_check_mark: | N/A | | `text` | *str* | :heavy_check_mark: | N/A |
| `cache_control` | [Optional[components.ChatMessageContentItemCacheControl]](../components/chatmessagecontentitemcachecontrol.md) | :heavy_minus_sign: | N/A |
@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
| `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A | | `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A |
| `video_url` | [components.VideoURL1](../components/videourl1.md) | :heavy_check_mark: | N/A | | `video_url` | [components.VideoURL](../components/videourl.md) | :heavy_check_mark: | N/A |
@@ -3,7 +3,7 @@
## Fields ## Fields
| Field | Type | Required | Description | | Field | Type | Required | Description |
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `type` | *Literal["video_url"]* | :heavy_check_mark: | N/A | | `type` | *Literal["video_url"]* | :heavy_check_mark: | N/A |
| `video_url` | [components.VideoURL2](../components/videourl2.md) | :heavy_check_mark: | N/A | | `video_url` | [components.ChatMessageContentItemVideoVideoURLVideoURL](../components/chatmessagecontentitemvideovideourlvideourl.md) | :heavy_check_mark: | N/A |
@@ -1,4 +1,4 @@
# VideoURL2 # ChatMessageContentItemVideoVideoURLVideoURL
## Fields ## Fields
+1 -3
View File
@@ -8,6 +8,4 @@
| `text` | *str* | :heavy_check_mark: | N/A | | `text` | *str* | :heavy_check_mark: | N/A |
| `index` | *float* | :heavy_check_mark: | N/A | | `index` | *float* | :heavy_check_mark: | N/A |
| `logprobs` | [Nullable[components.CompletionLogprobs]](../components/completionlogprobs.md) | :heavy_check_mark: | N/A | | `logprobs` | [Nullable[components.CompletionLogprobs]](../components/completionlogprobs.md) | :heavy_check_mark: | N/A |
| `finish_reason` | [Nullable[components.CompletionFinishReason]](../components/completionfinishreason.md) | :heavy_check_mark: | N/A | | `finish_reason` | [Nullable[components.CompletionFinishReason]](../components/completionfinishreason.md) | :heavy_check_mark: | N/A |
| `native_finish_reason` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
-1
View File
@@ -9,7 +9,6 @@
| `object` | *Literal["text_completion"]* | :heavy_check_mark: | N/A | | `object` | *Literal["text_completion"]* | :heavy_check_mark: | N/A |
| `created` | *float* | :heavy_check_mark: | N/A | | `created` | *float* | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A | | `model` | *str* | :heavy_check_mark: | N/A |
| `provider` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | N/A | | `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `choices` | List[[components.CompletionChoice](../components/completionchoice.md)] | :heavy_check_mark: | N/A | | `choices` | List[[components.CompletionChoice](../components/completionchoice.md)] | :heavy_check_mark: | N/A |
| `usage` | [Optional[components.CompletionUsage]](../components/completionusage.md) | :heavy_minus_sign: | N/A | | `usage` | [Optional[components.CompletionUsage]](../components/completionusage.md) | :heavy_minus_sign: | N/A |
-8
View File
@@ -1,8 +0,0 @@
# Debug
## Fields
| Field | Type | Required | Description |
| -------------------- | -------------------- | -------------------- | -------------------- |
| `echo_upstream_body` | *Optional[bool]* | :heavy_minus_sign: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# File
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `file_data` | *str* | :heavy_check_mark: | N/A |
| `file_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `filename` | *Optional[str]* | :heavy_minus_sign: | N/A |
-8
View File
@@ -1,8 +0,0 @@
# IDResponseHealing
## Values
| Name | Value |
| ------------------ | ------------------ |
| `RESPONSE_HEALING` | response-healing |
+2 -2
View File
@@ -27,8 +27,8 @@ Request schema for Responses endpoint
| `include` | List[[components.OpenAIResponsesIncludable](../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | | | `include` | List[[components.OpenAIResponsesIncludable](../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `store` | *Optional[Literal[False]]* | :heavy_minus_sign: | N/A | | | `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `service_tier` | [Optional[components.ServiceTier]](../components/servicetier.md) | :heavy_minus_sign: | N/A | | | `service_tier` | [OptionalNullable[components.ServiceTier]](../components/servicetier.md) | :heavy_minus_sign: | N/A | auto |
| `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.md) | :heavy_minus_sign: | N/A | auto | | `truncation` | [OptionalNullable[components.Truncation]](../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `provider` | [OptionalNullable[components.Provider]](../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
-6
View File
@@ -21,9 +21,3 @@ value: components.PluginWeb = /* values here */
value: components.PluginFileParser = /* values here */ value: components.PluginFileParser = /* values here */
``` ```
### `components.PluginResponseHealing`
```python
value: components.PluginResponseHealing = /* values here */
```
-8
View File
@@ -1,8 +0,0 @@
# PluginResponseHealing
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `id` | [components.IDResponseHealing](../components/idresponsehealing.md) | :heavy_check_mark: | N/A |
+1 -5
View File
@@ -9,14 +9,12 @@
| `AION_LABS` | AionLabs | | `AION_LABS` | AionLabs |
| `ALIBABA` | Alibaba | | `ALIBABA` | Alibaba |
| `AMAZON_BEDROCK` | Amazon Bedrock | | `AMAZON_BEDROCK` | Amazon Bedrock |
| `AMAZON_NOVA` | Amazon Nova |
| `ANTHROPIC` | Anthropic | | `ANTHROPIC` | Anthropic |
| `ARCEE_AI` | Arcee AI | | `ARCEE` | Arcee |
| `ATLAS_CLOUD` | AtlasCloud | | `ATLAS_CLOUD` | AtlasCloud |
| `AVIAN` | Avian | | `AVIAN` | Avian |
| `AZURE` | Azure | | `AZURE` | Azure |
| `BASE_TEN` | BaseTen | | `BASE_TEN` | BaseTen |
| `BYTE_PLUS` | BytePlus |
| `BLACK_FOREST_LABS` | Black Forest Labs | | `BLACK_FOREST_LABS` | Black Forest Labs |
| `CEREBRAS` | Cerebras | | `CEREBRAS` | Cerebras |
| `CHUTES` | Chutes | | `CHUTES` | Chutes |
@@ -31,7 +29,6 @@
| `FIREWORKS` | Fireworks | | `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli | | `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud | | `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google | | `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio | | `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq | | `GROQ` | Groq |
@@ -62,7 +59,6 @@
| `SAMBA_NOVA` | SambaNova | | `SAMBA_NOVA` | SambaNova |
| `SILICON_FLOW` | SiliconFlow | | `SILICON_FLOW` | SiliconFlow |
| `STEALTH` | Stealth | | `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint | | `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon | | `TARGON` | Targon |
| `TOGETHER` | Together | | `TOGETHER` | Together |
+7 -3
View File
@@ -3,6 +3,10 @@
## Values ## Values
| Name | Value | | Name | Value |
| ------ | ------ | | ---------- | ---------- |
| `AUTO` | auto | | `AUTO` | auto |
| `DEFAULT` | default |
| `FLEX` | flex |
| `PRIORITY` | priority |
| `SCALE` | scale |
-9
View File
@@ -1,9 +0,0 @@
# TTL
## Values
| Name | Value |
| ------- | ------- |
| `FIVEM` | 5m |
| `ONEH` | 1h |
@@ -1,4 +1,4 @@
# VideoURL1 # VideoURL
## Fields ## Fields
+12 -9
View File
@@ -1,14 +1,17 @@
# CreateEmbeddingsResponse # CreateEmbeddingsResponse
Embedding response
## Supported Types
## Fields ### `operations.CreateEmbeddingsResponseBody`
```python
value: operations.CreateEmbeddingsResponseBody = /* values here */
```
### `str`
```python
value: str = /* values here */
```
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `object` | [operations.Object](../operations/object.md) | :heavy_check_mark: | N/A |
| `data` | List[[operations.CreateEmbeddingsData](../operations/createembeddingsdata.md)] | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `usage` | [Optional[operations.Usage]](../operations/usage.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,14 @@
# CreateEmbeddingsResponseBody
Embedding response
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `object` | [operations.Object](../operations/object.md) | :heavy_check_mark: | N/A |
| `data` | List[[operations.CreateEmbeddingsData](../operations/createembeddingsdata.md)] | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `usage` | [Optional[operations.Usage]](../operations/usage.md) | :heavy_minus_sign: | N/A |
-9
View File
@@ -1,9 +0,0 @@
# GetCreditsData
## Fields
| Field | Type | Required | Description | Example |
| ----------------------- | ----------------------- | ----------------------- | ----------------------- | ----------------------- |
| `total_credits` | *float* | :heavy_check_mark: | Total credits purchased | 100.5 |
| `total_usage` | *float* | :heavy_check_mark: | Total credits used | 25.75 |
+2 -3
View File
@@ -5,6 +5,5 @@ Total credits purchased and used
## Fields ## Fields
| Field | Type | Required | Description | Example | | Field | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | ----------- | ----------- | ----------- | ----------- |
| `data` | [operations.GetCreditsData](../operations/getcreditsdata.md) | :heavy_check_mark: | N/A | {<br/>"total_credits": 100.5,<br/>"total_usage": 25.75<br/>} |
+1 -5
View File
@@ -9,14 +9,12 @@
| `AION_LABS` | AionLabs | | `AION_LABS` | AionLabs |
| `ALIBABA` | Alibaba | | `ALIBABA` | Alibaba |
| `AMAZON_BEDROCK` | Amazon Bedrock | | `AMAZON_BEDROCK` | Amazon Bedrock |
| `AMAZON_NOVA` | Amazon Nova |
| `ANTHROPIC` | Anthropic | | `ANTHROPIC` | Anthropic |
| `ARCEE_AI` | Arcee AI | | `ARCEE` | Arcee |
| `ATLAS_CLOUD` | AtlasCloud | | `ATLAS_CLOUD` | AtlasCloud |
| `AVIAN` | Avian | | `AVIAN` | Avian |
| `AZURE` | Azure | | `AZURE` | Azure |
| `BASE_TEN` | BaseTen | | `BASE_TEN` | BaseTen |
| `BYTE_PLUS` | BytePlus |
| `BLACK_FOREST_LABS` | Black Forest Labs | | `BLACK_FOREST_LABS` | Black Forest Labs |
| `CEREBRAS` | Cerebras | | `CEREBRAS` | Cerebras |
| `CHUTES` | Chutes | | `CHUTES` | Chutes |
@@ -31,7 +29,6 @@
| `FIREWORKS` | Fireworks | | `FIREWORKS` | Fireworks |
| `FRIENDLI` | Friendli | | `FRIENDLI` | Friendli |
| `GMI_CLOUD` | GMICloud | | `GMI_CLOUD` | GMICloud |
| `GO_POMELO` | GoPomelo |
| `GOOGLE` | Google | | `GOOGLE` | Google |
| `GOOGLE_AI_STUDIO` | Google AI Studio | | `GOOGLE_AI_STUDIO` | Google AI Studio |
| `GROQ` | Groq | | `GROQ` | Groq |
@@ -62,7 +59,6 @@
| `SAMBA_NOVA` | SambaNova | | `SAMBA_NOVA` | SambaNova |
| `SILICON_FLOW` | SiliconFlow | | `SILICON_FLOW` | SiliconFlow |
| `STEALTH` | Stealth | | `STEALTH` | Stealth |
| `STREAM_LAKE` | StreamLake |
| `SWITCHPOINT` | Switchpoint | | `SWITCHPOINT` | Switchpoint |
| `TARGON` | Targon | | `TARGON` | Targon |
| `TOGETHER` | Together | | `TOGETHER` | Together |
+1 -1
View File
@@ -6,4 +6,4 @@
| Field | Type | Required | Description | Example | | Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to update | 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 | | `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to update | 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 |
| `body` | [operations.UpdateKeysRequestBody](../operations/updatekeysrequestbody.md) | :heavy_check_mark: | N/A | {<br/>"name": "Updated API Key Name",<br/>"disabled": false,<br/>"limit": 75,<br/>"limit_reset": "daily",<br/>"include_byok_in_limit": true<br/>} | | `request_body` | [operations.UpdateKeysRequestBody](../operations/updatekeysrequestbody.md) | :heavy_check_mark: | N/A | {<br/>"name": "Updated API Key Name",<br/>"disabled": false,<br/>"limit": 75,<br/>"limit_reset": "daily",<br/>"include_byok_in_limit": true<br/>} |
+2 -3
View File
@@ -67,7 +67,6 @@ Create a new API key
<!-- UsageSnippet language="python" operationID="createKeys" method="post" path="/keys" --> <!-- UsageSnippet language="python" operationID="createKeys" method="post" path="/keys" -->
```python ```python
from openrouter import OpenRouter from openrouter import OpenRouter
from openrouter.utils import parse_datetime
import os import os
@@ -75,7 +74,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.api_keys.create(name="My New API Key", limit=50, limit_reset="monthly", include_byok_in_limit=True, expires_at=parse_datetime("2027-12-31T23:59:59Z")) res = open_router.api_keys.create(name="My New API Key")
# Handle response # Handle response
print(res) print(res)
@@ -123,7 +122,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.api_keys.update(hash="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", name="Updated API Key Name", disabled=False, limit=75, limit_reset="daily", include_byok_in_limit=True) res = open_router.api_keys.update(hash="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")
# Handle response # Handle response
print(res) print(res)
-1
View File
@@ -58,7 +58,6 @@ with OpenRouter(
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A | | `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | | `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A | | `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response ### Response
+1 -18
View File
@@ -26,24 +26,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.embeddings.generate(input="<value>", model="Taurus", provider={ res = open_router.embeddings.generate(input="<value>", model="Taurus")
"data_collection": "allow",
"zdr": True,
"enforce_distillable_text": True,
"order": [
"OpenAI",
],
"only": [
"OpenAI",
],
"ignore": [
"OpenAI",
],
"quantizations": [
"fp16",
],
"sort": "price",
})
# Handle response # Handle response
print(res) print(res)
+2 -2
View File
@@ -26,7 +26,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.o_auth.exchange_auth_code_for_api_key(code="auth_code_abc123def456", code_verifier="dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk", code_challenge_method="S256") res = open_router.o_auth.exchange_auth_code_for_api_key(code="auth_code_abc123def456")
# Handle response # Handle response
print(res) print(res)
@@ -71,7 +71,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.o_auth.create_auth_code(callback_url="https://myapp.com/auth/callback", code_challenge="E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM", code_challenge_method="S256", limit=100) res = open_router.o_auth.create_auth_code(callback_url="https://myapp.com/auth/callback")
# Handle response # Handle response
print(res) print(res)
+3 -56
View File
@@ -25,61 +25,7 @@ with OpenRouter(
api_key=os.getenv("OPENROUTER_API_KEY", ""), api_key=os.getenv("OPENROUTER_API_KEY", ""),
) as open_router: ) as open_router:
res = open_router.beta.responses.send(input=[ res = open_router.beta.responses.send(stream=False)
{
"type": "message",
"role": "user",
"content": "Hello, how are you?",
},
], metadata={
"user_id": "123",
"session_id": "abc-def-ghi",
}, tools=[
{
"type": "function",
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
},
},
},
},
], model="anthropic/claude-4.5-sonnet-20250929", text={
"format_": {
"type": "text",
},
"verbosity": "medium",
}, reasoning={
"summary": "auto",
"enabled": True,
}, temperature=0.7, top_p=0.9, prompt={
"id": "<id>",
"variables": {
"key": {
"type": "input_text",
"text": "Hello, how can I help you?",
},
},
}, service_tier="auto", truncation="auto", stream=False, provider={
"data_collection": "allow",
"zdr": True,
"enforce_distillable_text": True,
"order": [
"OpenAI",
],
"only": [
"OpenAI",
],
"ignore": [
"OpenAI",
],
"quantizations": None,
"sort": "price",
})
with res as event_stream: with res as event_stream:
for event in event_stream: for event in event_stream:
@@ -112,7 +58,8 @@ with OpenRouter(
| `include` | List[[components.OpenAIResponsesIncludable](../../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | | | `include` | List[[components.OpenAIResponsesIncludable](../../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | | | `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | | `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `service_tier` | [Optional[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | | | `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `service_tier` | [OptionalNullable[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | auto |
| `truncation` | [OptionalNullable[components.Truncation]](../../components/truncation.md) | :heavy_minus_sign: | N/A | auto | | `truncation` | [OptionalNullable[components.Truncation]](../../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | | | `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `provider` | [OptionalNullable[components.Provider]](../../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | | | `provider` | [OptionalNullable[components.Provider]](../../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "openrouter" name = "openrouter"
version = "0.1.1" version = "0.0.16"
description = "Official Python Client SDK for OpenRouter." description = "Official Python Client SDK for OpenRouter."
authors = [{ name = "OpenRouter" },] authors = [{ name = "OpenRouter" },]
readme = "README-PYPI.md" readme = "README-PYPI.md"
+2 -2
View File
@@ -3,10 +3,10 @@
import importlib.metadata import importlib.metadata
__title__: str = "openrouter" __title__: str = "openrouter"
__version__: str = "0.1.1" __version__: str = "0.0.16"
__openapi_doc_version__: str = "1.0.0" __openapi_doc_version__: str = "1.0.0"
__gen_version__: str = "2.768.0" __gen_version__: str = "2.768.0"
__user_agent__: str = "speakeasy-sdk/python 0.1.1 2.768.0 1.0.0 openrouter" __user_agent__: str = "speakeasy-sdk/python 0.0.16 2.768.0 1.0.0 openrouter"
try: try:
if __package__ is not None: if __package__ is not None:
+12 -4
View File
@@ -506,7 +506,7 @@ class APIKeys(BaseSDK):
request = operations.UpdateKeysRequest( request = operations.UpdateKeysRequest(
hash=hash, hash=hash,
body=operations.UpdateKeysRequestBody( request_body=operations.UpdateKeysRequestBody(
name=name, name=name,
disabled=disabled, disabled=disabled,
limit=limit, limit=limit,
@@ -529,7 +529,11 @@ class APIKeys(BaseSDK):
http_headers=http_headers, http_headers=http_headers,
security=self.sdk_configuration.security, security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body( get_serialized_body=lambda: utils.serialize_request_body(
request.body, False, False, "json", operations.UpdateKeysRequestBody request.request_body,
False,
False,
"json",
operations.UpdateKeysRequestBody,
), ),
allow_empty_value=None, allow_empty_value=None,
timeout_ms=timeout_ms, timeout_ms=timeout_ms,
@@ -638,7 +642,7 @@ class APIKeys(BaseSDK):
request = operations.UpdateKeysRequest( request = operations.UpdateKeysRequest(
hash=hash, hash=hash,
body=operations.UpdateKeysRequestBody( request_body=operations.UpdateKeysRequestBody(
name=name, name=name,
disabled=disabled, disabled=disabled,
limit=limit, limit=limit,
@@ -661,7 +665,11 @@ class APIKeys(BaseSDK):
http_headers=http_headers, http_headers=http_headers,
security=self.sdk_configuration.security, security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body( get_serialized_body=lambda: utils.serialize_request_body(
request.body, False, False, "json", operations.UpdateKeysRequestBody request.request_body,
False,
False,
"json",
operations.UpdateKeysRequestBody,
), ),
allow_empty_value=None, allow_empty_value=None,
timeout_ms=timeout_ms, timeout_ms=timeout_ms,
-14
View File
@@ -61,7 +61,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -93,7 +92,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -146,7 +144,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -178,7 +175,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -230,7 +226,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -262,7 +257,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -311,7 +305,6 @@ class Chat(BaseSDK):
), ),
top_p=top_p, top_p=top_p,
user=user, user=user,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
) )
req = self._build_request( req = self._build_request(
@@ -446,7 +439,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -478,7 +470,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -531,7 +522,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -563,7 +553,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -615,7 +604,6 @@ class Chat(BaseSDK):
] = None, ] = None,
top_p: OptionalNullable[float] = UNSET, top_p: OptionalNullable[float] = UNSET,
user: Optional[str] = None, user: Optional[str] = None,
debug: Optional[Union[components.Debug, components.DebugTypedDict]] = None,
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
@@ -647,7 +635,6 @@ class Chat(BaseSDK):
:param tools: :param tools:
:param top_p: :param top_p:
:param user: :param user:
:param debug:
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -696,7 +683,6 @@ class Chat(BaseSDK):
), ),
top_p=top_p, top_p=top_p,
user=user, user=user,
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
) )
req = self._build_request_async( req = self._build_request_async(
+37 -43
View File
@@ -21,7 +21,6 @@ if TYPE_CHECKING:
BadRequestResponseErrorData, BadRequestResponseErrorData,
BadRequestResponseErrorDataTypedDict, BadRequestResponseErrorDataTypedDict,
) )
from .chatcompletionfinishreason import ChatCompletionFinishReason
from .chaterror import ChatErrorError, ChatErrorErrorTypedDict, Code, CodeTypedDict from .chaterror import ChatErrorError, ChatErrorErrorTypedDict, Code, CodeTypedDict
from .chatgenerationparams import ( from .chatgenerationparams import (
ChatGenerationParams, ChatGenerationParams,
@@ -36,8 +35,6 @@ if TYPE_CHECKING:
ChatGenerationParamsStop, ChatGenerationParamsStop,
ChatGenerationParamsStopTypedDict, ChatGenerationParamsStopTypedDict,
ChatGenerationParamsTypedDict, ChatGenerationParamsTypedDict,
Debug,
DebugTypedDict,
Effort, Effort,
Reasoning, Reasoning,
ReasoningTypedDict, ReasoningTypedDict,
@@ -56,14 +53,16 @@ if TYPE_CHECKING:
) )
from .chatmessagecontentitemaudio import ( from .chatmessagecontentitemaudio import (
ChatMessageContentItemAudio, ChatMessageContentItemAudio,
ChatMessageContentItemAudioFormat,
ChatMessageContentItemAudioInputAudio, ChatMessageContentItemAudioInputAudio,
ChatMessageContentItemAudioInputAudioTypedDict, ChatMessageContentItemAudioInputAudioTypedDict,
ChatMessageContentItemAudioTypedDict, ChatMessageContentItemAudioTypedDict,
) )
from .chatmessagecontentitemcachecontrol import ( from .chatmessagecontentitemfile import (
ChatMessageContentItemCacheControl, ChatMessageContentItemFile,
ChatMessageContentItemCacheControlTypedDict, ChatMessageContentItemFileTypedDict,
TTL, File,
FileTypedDict,
) )
from .chatmessagecontentitemimage import ( from .chatmessagecontentitemimage import (
ChatMessageContentItemImage, ChatMessageContentItemImage,
@@ -83,10 +82,8 @@ if TYPE_CHECKING:
ChatMessageContentItemVideoTypedDict, ChatMessageContentItemVideoTypedDict,
ChatMessageContentItemVideoVideoURL, ChatMessageContentItemVideoVideoURL,
ChatMessageContentItemVideoVideoURLTypedDict, ChatMessageContentItemVideoVideoURLTypedDict,
VideoURL1, ChatMessageContentItemVideoVideoURLVideoURL,
VideoURL1TypedDict, ChatMessageContentItemVideoVideoURLVideoURLTypedDict,
VideoURL2,
VideoURL2TypedDict,
) )
from .chatmessagetokenlogprob import ( from .chatmessagetokenlogprob import (
ChatMessageTokenLogprob, ChatMessageTokenLogprob,
@@ -105,8 +102,13 @@ if TYPE_CHECKING:
ChatMessageToolCallTypedDict, ChatMessageToolCallTypedDict,
) )
from .chatresponse import ChatResponse, ChatResponseTypedDict from .chatresponse import ChatResponse, ChatResponseTypedDict
from .chatresponsechoice import ChatResponseChoice, ChatResponseChoiceTypedDict from .chatresponsechoice import (
from .chatstreamingchoice import ChatStreamingChoice, ChatStreamingChoiceTypedDict ChatCompletionFinishReason,
ChatResponseChoice,
ChatResponseChoiceTypedDict,
ChatStreamingChoice,
ChatStreamingChoiceTypedDict,
)
from .chatstreamingmessagechunk import ( from .chatstreamingmessagechunk import (
ChatStreamingMessageChunk, ChatStreamingMessageChunk,
ChatStreamingMessageChunkRole, ChatStreamingMessageChunkRole,
@@ -424,7 +426,6 @@ if TYPE_CHECKING:
Engine, Engine,
IDFileParser, IDFileParser,
IDModeration, IDModeration,
IDResponseHealing,
IDWeb, IDWeb,
Ignore, Ignore,
IgnoreTypedDict, IgnoreTypedDict,
@@ -449,8 +450,6 @@ if TYPE_CHECKING:
PluginFileParserTypedDict, PluginFileParserTypedDict,
PluginModeration, PluginModeration,
PluginModerationTypedDict, PluginModerationTypedDict,
PluginResponseHealing,
PluginResponseHealingTypedDict,
PluginTypedDict, PluginTypedDict,
PluginWeb, PluginWeb,
PluginWebTypedDict, PluginWebTypedDict,
@@ -785,6 +784,7 @@ if TYPE_CHECKING:
UserMessageContentTypedDict, UserMessageContentTypedDict,
UserMessageTypedDict, UserMessageTypedDict,
) )
from .videourl import VideoURL, VideoURLTypedDict
from .websearchpreviewtooluserlocation import ( from .websearchpreviewtooluserlocation import (
WebSearchPreviewToolUserLocation, WebSearchPreviewToolUserLocation,
WebSearchPreviewToolUserLocationType, WebSearchPreviewToolUserLocationType,
@@ -825,11 +825,12 @@ __all__ = [
"ChatGenerationTokenUsageTypedDict", "ChatGenerationTokenUsageTypedDict",
"ChatMessageContentItem", "ChatMessageContentItem",
"ChatMessageContentItemAudio", "ChatMessageContentItemAudio",
"ChatMessageContentItemAudioFormat",
"ChatMessageContentItemAudioInputAudio", "ChatMessageContentItemAudioInputAudio",
"ChatMessageContentItemAudioInputAudioTypedDict", "ChatMessageContentItemAudioInputAudioTypedDict",
"ChatMessageContentItemAudioTypedDict", "ChatMessageContentItemAudioTypedDict",
"ChatMessageContentItemCacheControl", "ChatMessageContentItemFile",
"ChatMessageContentItemCacheControlTypedDict", "ChatMessageContentItemFileTypedDict",
"ChatMessageContentItemImage", "ChatMessageContentItemImage",
"ChatMessageContentItemImageDetail", "ChatMessageContentItemImageDetail",
"ChatMessageContentItemImageTypedDict", "ChatMessageContentItemImageTypedDict",
@@ -842,6 +843,8 @@ __all__ = [
"ChatMessageContentItemVideoTypedDict", "ChatMessageContentItemVideoTypedDict",
"ChatMessageContentItemVideoVideoURL", "ChatMessageContentItemVideoVideoURL",
"ChatMessageContentItemVideoVideoURLTypedDict", "ChatMessageContentItemVideoVideoURLTypedDict",
"ChatMessageContentItemVideoVideoURLVideoURL",
"ChatMessageContentItemVideoVideoURLVideoURLTypedDict",
"ChatMessageTokenLogprob", "ChatMessageTokenLogprob",
"ChatMessageTokenLogprobTypedDict", "ChatMessageTokenLogprobTypedDict",
"ChatMessageTokenLogprobs", "ChatMessageTokenLogprobs",
@@ -902,8 +905,6 @@ __all__ = [
"CreateChargeRequest", "CreateChargeRequest",
"CreateChargeRequestTypedDict", "CreateChargeRequestTypedDict",
"DataCollection", "DataCollection",
"Debug",
"DebugTypedDict",
"DefaultParameters", "DefaultParameters",
"DefaultParametersTypedDict", "DefaultParametersTypedDict",
"EdgeNetworkTimeoutResponseErrorData", "EdgeNetworkTimeoutResponseErrorData",
@@ -911,17 +912,18 @@ __all__ = [
"Effort", "Effort",
"EndpointStatus", "EndpointStatus",
"Engine", "Engine",
"File",
"FileCitation", "FileCitation",
"FileCitationType", "FileCitationType",
"FileCitationTypedDict", "FileCitationTypedDict",
"FilePath", "FilePath",
"FilePathType", "FilePathType",
"FilePathTypedDict", "FilePathTypedDict",
"FileTypedDict",
"ForbiddenResponseErrorData", "ForbiddenResponseErrorData",
"ForbiddenResponseErrorDataTypedDict", "ForbiddenResponseErrorDataTypedDict",
"IDFileParser", "IDFileParser",
"IDModeration", "IDModeration",
"IDResponseHealing",
"IDWeb", "IDWeb",
"Ignore", "Ignore",
"IgnoreTypedDict", "IgnoreTypedDict",
@@ -1215,8 +1217,6 @@ __all__ = [
"PluginFileParserTypedDict", "PluginFileParserTypedDict",
"PluginModeration", "PluginModeration",
"PluginModerationTypedDict", "PluginModerationTypedDict",
"PluginResponseHealing",
"PluginResponseHealingTypedDict",
"PluginTypedDict", "PluginTypedDict",
"PluginWeb", "PluginWeb",
"PluginWebTypedDict", "PluginWebTypedDict",
@@ -1342,7 +1342,6 @@ __all__ = [
"SystemMessageContent", "SystemMessageContent",
"SystemMessageContentTypedDict", "SystemMessageContentTypedDict",
"SystemMessageTypedDict", "SystemMessageTypedDict",
"TTL",
"Tokenizer", "Tokenizer",
"TooManyRequestsResponseErrorData", "TooManyRequestsResponseErrorData",
"TooManyRequestsResponseErrorDataTypedDict", "TooManyRequestsResponseErrorDataTypedDict",
@@ -1392,10 +1391,8 @@ __all__ = [
"UserMessageTypedDict", "UserMessageTypedDict",
"Variables", "Variables",
"VariablesTypedDict", "VariablesTypedDict",
"VideoURL1", "VideoURL",
"VideoURL1TypedDict", "VideoURLTypedDict",
"VideoURL2",
"VideoURL2TypedDict",
"WebSearchPreviewToolUserLocation", "WebSearchPreviewToolUserLocation",
"WebSearchPreviewToolUserLocationType", "WebSearchPreviewToolUserLocationType",
"WebSearchPreviewToolUserLocationTypedDict", "WebSearchPreviewToolUserLocationTypedDict",
@@ -1413,7 +1410,6 @@ _dynamic_imports: dict[str, str] = {
"BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata", "BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata",
"BadRequestResponseErrorData": ".badrequestresponseerrordata", "BadRequestResponseErrorData": ".badrequestresponseerrordata",
"BadRequestResponseErrorDataTypedDict": ".badrequestresponseerrordata", "BadRequestResponseErrorDataTypedDict": ".badrequestresponseerrordata",
"ChatCompletionFinishReason": ".chatcompletionfinishreason",
"ChatErrorError": ".chaterror", "ChatErrorError": ".chaterror",
"ChatErrorErrorTypedDict": ".chaterror", "ChatErrorErrorTypedDict": ".chaterror",
"Code": ".chaterror", "Code": ".chaterror",
@@ -1430,8 +1426,6 @@ _dynamic_imports: dict[str, str] = {
"ChatGenerationParamsStop": ".chatgenerationparams", "ChatGenerationParamsStop": ".chatgenerationparams",
"ChatGenerationParamsStopTypedDict": ".chatgenerationparams", "ChatGenerationParamsStopTypedDict": ".chatgenerationparams",
"ChatGenerationParamsTypedDict": ".chatgenerationparams", "ChatGenerationParamsTypedDict": ".chatgenerationparams",
"Debug": ".chatgenerationparams",
"DebugTypedDict": ".chatgenerationparams",
"Effort": ".chatgenerationparams", "Effort": ".chatgenerationparams",
"Reasoning": ".chatgenerationparams", "Reasoning": ".chatgenerationparams",
"ReasoningTypedDict": ".chatgenerationparams", "ReasoningTypedDict": ".chatgenerationparams",
@@ -1444,12 +1438,14 @@ _dynamic_imports: dict[str, str] = {
"ChatMessageContentItem": ".chatmessagecontentitem", "ChatMessageContentItem": ".chatmessagecontentitem",
"ChatMessageContentItemTypedDict": ".chatmessagecontentitem", "ChatMessageContentItemTypedDict": ".chatmessagecontentitem",
"ChatMessageContentItemAudio": ".chatmessagecontentitemaudio", "ChatMessageContentItemAudio": ".chatmessagecontentitemaudio",
"ChatMessageContentItemAudioFormat": ".chatmessagecontentitemaudio",
"ChatMessageContentItemAudioInputAudio": ".chatmessagecontentitemaudio", "ChatMessageContentItemAudioInputAudio": ".chatmessagecontentitemaudio",
"ChatMessageContentItemAudioInputAudioTypedDict": ".chatmessagecontentitemaudio", "ChatMessageContentItemAudioInputAudioTypedDict": ".chatmessagecontentitemaudio",
"ChatMessageContentItemAudioTypedDict": ".chatmessagecontentitemaudio", "ChatMessageContentItemAudioTypedDict": ".chatmessagecontentitemaudio",
"ChatMessageContentItemCacheControl": ".chatmessagecontentitemcachecontrol", "ChatMessageContentItemFile": ".chatmessagecontentitemfile",
"ChatMessageContentItemCacheControlTypedDict": ".chatmessagecontentitemcachecontrol", "ChatMessageContentItemFileTypedDict": ".chatmessagecontentitemfile",
"TTL": ".chatmessagecontentitemcachecontrol", "File": ".chatmessagecontentitemfile",
"FileTypedDict": ".chatmessagecontentitemfile",
"ChatMessageContentItemImage": ".chatmessagecontentitemimage", "ChatMessageContentItemImage": ".chatmessagecontentitemimage",
"ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage", "ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage",
"ChatMessageContentItemImageTypedDict": ".chatmessagecontentitemimage", "ChatMessageContentItemImageTypedDict": ".chatmessagecontentitemimage",
@@ -1463,10 +1459,8 @@ _dynamic_imports: dict[str, str] = {
"ChatMessageContentItemVideoTypedDict": ".chatmessagecontentitemvideo", "ChatMessageContentItemVideoTypedDict": ".chatmessagecontentitemvideo",
"ChatMessageContentItemVideoVideoURL": ".chatmessagecontentitemvideo", "ChatMessageContentItemVideoVideoURL": ".chatmessagecontentitemvideo",
"ChatMessageContentItemVideoVideoURLTypedDict": ".chatmessagecontentitemvideo", "ChatMessageContentItemVideoVideoURLTypedDict": ".chatmessagecontentitemvideo",
"VideoURL1": ".chatmessagecontentitemvideo", "ChatMessageContentItemVideoVideoURLVideoURL": ".chatmessagecontentitemvideo",
"VideoURL1TypedDict": ".chatmessagecontentitemvideo", "ChatMessageContentItemVideoVideoURLVideoURLTypedDict": ".chatmessagecontentitemvideo",
"VideoURL2": ".chatmessagecontentitemvideo",
"VideoURL2TypedDict": ".chatmessagecontentitemvideo",
"ChatMessageTokenLogprob": ".chatmessagetokenlogprob", "ChatMessageTokenLogprob": ".chatmessagetokenlogprob",
"ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob", "ChatMessageTokenLogprobTypedDict": ".chatmessagetokenlogprob",
"TopLogprob": ".chatmessagetokenlogprob", "TopLogprob": ".chatmessagetokenlogprob",
@@ -1479,10 +1473,11 @@ _dynamic_imports: dict[str, str] = {
"ChatMessageToolCallTypedDict": ".chatmessagetoolcall", "ChatMessageToolCallTypedDict": ".chatmessagetoolcall",
"ChatResponse": ".chatresponse", "ChatResponse": ".chatresponse",
"ChatResponseTypedDict": ".chatresponse", "ChatResponseTypedDict": ".chatresponse",
"ChatCompletionFinishReason": ".chatresponsechoice",
"ChatResponseChoice": ".chatresponsechoice", "ChatResponseChoice": ".chatresponsechoice",
"ChatResponseChoiceTypedDict": ".chatresponsechoice", "ChatResponseChoiceTypedDict": ".chatresponsechoice",
"ChatStreamingChoice": ".chatstreamingchoice", "ChatStreamingChoice": ".chatresponsechoice",
"ChatStreamingChoiceTypedDict": ".chatstreamingchoice", "ChatStreamingChoiceTypedDict": ".chatresponsechoice",
"ChatStreamingMessageChunk": ".chatstreamingmessagechunk", "ChatStreamingMessageChunk": ".chatstreamingmessagechunk",
"ChatStreamingMessageChunkRole": ".chatstreamingmessagechunk", "ChatStreamingMessageChunkRole": ".chatstreamingmessagechunk",
"ChatStreamingMessageChunkTypedDict": ".chatstreamingmessagechunk", "ChatStreamingMessageChunkTypedDict": ".chatstreamingmessagechunk",
@@ -1729,7 +1724,6 @@ _dynamic_imports: dict[str, str] = {
"Engine": ".openresponsesrequest", "Engine": ".openresponsesrequest",
"IDFileParser": ".openresponsesrequest", "IDFileParser": ".openresponsesrequest",
"IDModeration": ".openresponsesrequest", "IDModeration": ".openresponsesrequest",
"IDResponseHealing": ".openresponsesrequest",
"IDWeb": ".openresponsesrequest", "IDWeb": ".openresponsesrequest",
"Ignore": ".openresponsesrequest", "Ignore": ".openresponsesrequest",
"IgnoreTypedDict": ".openresponsesrequest", "IgnoreTypedDict": ".openresponsesrequest",
@@ -1754,8 +1748,6 @@ _dynamic_imports: dict[str, str] = {
"PluginFileParserTypedDict": ".openresponsesrequest", "PluginFileParserTypedDict": ".openresponsesrequest",
"PluginModeration": ".openresponsesrequest", "PluginModeration": ".openresponsesrequest",
"PluginModerationTypedDict": ".openresponsesrequest", "PluginModerationTypedDict": ".openresponsesrequest",
"PluginResponseHealing": ".openresponsesrequest",
"PluginResponseHealingTypedDict": ".openresponsesrequest",
"PluginTypedDict": ".openresponsesrequest", "PluginTypedDict": ".openresponsesrequest",
"PluginWeb": ".openresponsesrequest", "PluginWeb": ".openresponsesrequest",
"PluginWebTypedDict": ".openresponsesrequest", "PluginWebTypedDict": ".openresponsesrequest",
@@ -2006,6 +1998,8 @@ _dynamic_imports: dict[str, str] = {
"UserMessageContent": ".usermessage", "UserMessageContent": ".usermessage",
"UserMessageContentTypedDict": ".usermessage", "UserMessageContentTypedDict": ".usermessage",
"UserMessageTypedDict": ".usermessage", "UserMessageTypedDict": ".usermessage",
"VideoURL": ".videourl",
"VideoURLTypedDict": ".videourl",
"WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocation": ".websearchpreviewtooluserlocation",
"WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationType": ".websearchpreviewtooluserlocation",
"WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation", "WebSearchPreviewToolUserLocationTypedDict": ".websearchpreviewtooluserlocation",
@@ -1,17 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import UnrecognizedStr
from typing import Literal, Union
ChatCompletionFinishReason = Union[
Literal[
"tool_calls",
"stop",
"length",
"content_filter",
"error",
],
UnrecognizedStr,
]
@@ -156,14 +156,6 @@ ChatGenerationParamsStop = TypeAliasType(
) )
class DebugTypedDict(TypedDict):
echo_upstream_body: NotRequired[bool]
class Debug(BaseModel):
echo_upstream_body: Optional[bool] = None
class ChatGenerationParamsTypedDict(TypedDict): class ChatGenerationParamsTypedDict(TypedDict):
messages: List[MessageTypedDict] messages: List[MessageTypedDict]
model: NotRequired[str] model: NotRequired[str]
@@ -187,7 +179,6 @@ class ChatGenerationParamsTypedDict(TypedDict):
tools: NotRequired[List[ToolDefinitionJSONTypedDict]] tools: NotRequired[List[ToolDefinitionJSONTypedDict]]
top_p: NotRequired[Nullable[float]] top_p: NotRequired[Nullable[float]]
user: NotRequired[str] user: NotRequired[str]
debug: NotRequired[DebugTypedDict]
class ChatGenerationParams(BaseModel): class ChatGenerationParams(BaseModel):
@@ -235,8 +226,6 @@ class ChatGenerationParams(BaseModel):
user: Optional[str] = None user: Optional[str] = None
debug: Optional[Debug] = None
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = [ optional_fields = [
@@ -261,7 +250,6 @@ class ChatGenerationParams(BaseModel):
"tools", "tools",
"top_p", "top_p",
"user", "user",
"debug",
] ]
nullable_fields = [ nullable_fields = [
"frequency_penalty", "frequency_penalty",
@@ -5,6 +5,10 @@ from .chatmessagecontentitemaudio import (
ChatMessageContentItemAudio, ChatMessageContentItemAudio,
ChatMessageContentItemAudioTypedDict, ChatMessageContentItemAudioTypedDict,
) )
from .chatmessagecontentitemfile import (
ChatMessageContentItemFile,
ChatMessageContentItemFileTypedDict,
)
from .chatmessagecontentitemimage import ( from .chatmessagecontentitemimage import (
ChatMessageContentItemImage, ChatMessageContentItemImage,
ChatMessageContentItemImageTypedDict, ChatMessageContentItemImageTypedDict,
@@ -26,9 +30,10 @@ from typing_extensions import Annotated, TypeAliasType
ChatMessageContentItemTypedDict = TypeAliasType( ChatMessageContentItemTypedDict = TypeAliasType(
"ChatMessageContentItemTypedDict", "ChatMessageContentItemTypedDict",
Union[ Union[
ChatMessageContentItemTextTypedDict,
ChatMessageContentItemImageTypedDict, ChatMessageContentItemImageTypedDict,
ChatMessageContentItemAudioTypedDict, ChatMessageContentItemAudioTypedDict,
ChatMessageContentItemTextTypedDict, ChatMessageContentItemFileTypedDict,
ChatMessageContentItemVideoTypedDict, ChatMessageContentItemVideoTypedDict,
], ],
) )
@@ -41,6 +46,7 @@ ChatMessageContentItem = Annotated[
Annotated[ChatMessageContentItemAudio, Tag("input_audio")], Annotated[ChatMessageContentItemAudio, Tag("input_audio")],
Annotated[ChatMessageContentItemVideo, Tag("input_video")], Annotated[ChatMessageContentItemVideo, Tag("input_video")],
Annotated[ChatMessageContentItemVideo, Tag("video_url")], Annotated[ChatMessageContentItemVideo, Tag("video_url")],
Annotated[ChatMessageContentItemFile, Tag("file")],
], ],
Discriminator(lambda m: get_discriminator(m, "type", "type")), Discriminator(lambda m: get_discriminator(m, "type", "type")),
] ]
@@ -1,23 +1,42 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from openrouter.types import BaseModel from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_const from openrouter.utils import validate_const, validate_open_enum
import pydantic import pydantic
from pydantic.functional_validators import AfterValidator from pydantic.functional_validators import AfterValidator, PlainValidator
from typing import Literal from typing import Literal, Union
from typing_extensions import Annotated, TypedDict from typing_extensions import Annotated, TypedDict
ChatMessageContentItemAudioFormat = Union[
Literal[
"wav",
"mp3",
"flac",
"m4a",
"ogg",
"pcm16",
"pcm24",
],
UnrecognizedStr,
]
class ChatMessageContentItemAudioInputAudioTypedDict(TypedDict): class ChatMessageContentItemAudioInputAudioTypedDict(TypedDict):
data: str data: str
format_: str format_: ChatMessageContentItemAudioFormat
class ChatMessageContentItemAudioInputAudio(BaseModel): class ChatMessageContentItemAudioInputAudio(BaseModel):
data: str data: str
format_: Annotated[str, pydantic.Field(alias="format")] format_: Annotated[
Annotated[
ChatMessageContentItemAudioFormat, PlainValidator(validate_open_enum(False))
],
pydantic.Field(alias="format"),
]
class ChatMessageContentItemAudioTypedDict(TypedDict): class ChatMessageContentItemAudioTypedDict(TypedDict):
@@ -1,32 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel, UnrecognizedStr
from openrouter.utils import validate_const, validate_open_enum
import pydantic
from pydantic.functional_validators import AfterValidator, PlainValidator
from typing import Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict
TTL = Union[
Literal[
"5m",
"1h",
],
UnrecognizedStr,
]
class ChatMessageContentItemCacheControlTypedDict(TypedDict):
type: Literal["ephemeral"]
ttl: NotRequired[TTL]
class ChatMessageContentItemCacheControl(BaseModel):
TYPE: Annotated[
Annotated[Literal["ephemeral"], AfterValidator(validate_const("ephemeral"))],
pydantic.Field(alias="type"),
] = "ephemeral"
ttl: Annotated[Optional[TTL], PlainValidator(validate_open_enum(False))] = None
@@ -0,0 +1,37 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from openrouter.types import BaseModel
from openrouter.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class FileTypedDict(TypedDict):
file_data: str
file_id: NotRequired[str]
filename: NotRequired[str]
class File(BaseModel):
file_data: str
file_id: Optional[str] = None
filename: Optional[str] = None
class ChatMessageContentItemFileTypedDict(TypedDict):
file: FileTypedDict
type: Literal["file"]
class ChatMessageContentItemFile(BaseModel):
file: File
TYPE: Annotated[
Annotated[Literal["file"], AfterValidator(validate_const("file"))],
pydantic.Field(alias="type"),
] = "file"
@@ -1,22 +1,17 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from .chatmessagecontentitemcachecontrol import (
ChatMessageContentItemCacheControl,
ChatMessageContentItemCacheControlTypedDict,
)
from openrouter.types import BaseModel from openrouter.types import BaseModel
from openrouter.utils import validate_const from openrouter.utils import validate_const
import pydantic import pydantic
from pydantic.functional_validators import AfterValidator from pydantic.functional_validators import AfterValidator
from typing import Literal, Optional from typing import Literal
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, TypedDict
class ChatMessageContentItemTextTypedDict(TypedDict): class ChatMessageContentItemTextTypedDict(TypedDict):
text: str text: str
type: Literal["text"] type: Literal["text"]
cache_control: NotRequired[ChatMessageContentItemCacheControlTypedDict]
class ChatMessageContentItemText(BaseModel): class ChatMessageContentItemText(BaseModel):
@@ -26,5 +21,3 @@ class ChatMessageContentItemText(BaseModel):
Annotated[Literal["text"], AfterValidator(validate_const("text"))], Annotated[Literal["text"], AfterValidator(validate_const("text"))],
pydantic.Field(alias="type"), pydantic.Field(alias="type"),
] = "text" ] = "text"
cache_control: Optional[ChatMessageContentItemCacheControl] = None
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations from __future__ import annotations
from .videourl import VideoURL, VideoURLTypedDict
from openrouter.types import BaseModel from openrouter.types import BaseModel
from openrouter.utils import get_discriminator, validate_const from openrouter.utils import get_discriminator, validate_const
import pydantic import pydantic
@@ -10,21 +11,21 @@ from typing import Literal, Union
from typing_extensions import Annotated, TypeAliasType, TypedDict from typing_extensions import Annotated, TypeAliasType, TypedDict
class VideoURL2TypedDict(TypedDict): class ChatMessageContentItemVideoVideoURLVideoURLTypedDict(TypedDict):
url: str url: str
class VideoURL2(BaseModel): class ChatMessageContentItemVideoVideoURLVideoURL(BaseModel):
url: str url: str
class ChatMessageContentItemVideoVideoURLTypedDict(TypedDict): class ChatMessageContentItemVideoVideoURLTypedDict(TypedDict):
video_url: VideoURL2TypedDict video_url: ChatMessageContentItemVideoVideoURLVideoURLTypedDict
type: Literal["video_url"] type: Literal["video_url"]
class ChatMessageContentItemVideoVideoURL(BaseModel): class ChatMessageContentItemVideoVideoURL(BaseModel):
video_url: VideoURL2 video_url: ChatMessageContentItemVideoVideoURLVideoURL
TYPE: Annotated[ TYPE: Annotated[
Annotated[Literal["video_url"], AfterValidator(validate_const("video_url"))], Annotated[Literal["video_url"], AfterValidator(validate_const("video_url"))],
@@ -32,21 +33,13 @@ class ChatMessageContentItemVideoVideoURL(BaseModel):
] = "video_url" ] = "video_url"
class VideoURL1TypedDict(TypedDict):
url: str
class VideoURL1(BaseModel):
url: str
class ChatMessageContentItemVideoInputVideoTypedDict(TypedDict): class ChatMessageContentItemVideoInputVideoTypedDict(TypedDict):
video_url: VideoURL1TypedDict video_url: VideoURLTypedDict
type: Literal["input_video"] type: Literal["input_video"]
class ChatMessageContentItemVideoInputVideo(BaseModel): class ChatMessageContentItemVideoInputVideo(BaseModel):
video_url: VideoURL1 video_url: VideoURL
TYPE: Annotated[ TYPE: Annotated[
Annotated[ Annotated[
@@ -2,24 +2,41 @@
from __future__ import annotations from __future__ import annotations
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
from .chatcompletionfinishreason import ChatCompletionFinishReason
from .chatmessagetokenlogprobs import ( from .chatmessagetokenlogprobs import (
ChatMessageTokenLogprobs, ChatMessageTokenLogprobs,
ChatMessageTokenLogprobsTypedDict, ChatMessageTokenLogprobsTypedDict,
) )
from .chatstreamingmessagechunk import (
ChatStreamingMessageChunk,
ChatStreamingMessageChunkTypedDict,
)
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
Nullable, Nullable,
OptionalNullable, OptionalNullable,
UNSET, UNSET,
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr,
) )
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
from pydantic import model_serializer from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator from pydantic.functional_validators import PlainValidator
from typing import Literal, Union
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, NotRequired, TypedDict
ChatCompletionFinishReason = Union[
Literal[
"tool_calls",
"stop",
"length",
"content_filter",
"error",
],
UnrecognizedStr,
]
class ChatResponseChoiceTypedDict(TypedDict): class ChatResponseChoiceTypedDict(TypedDict):
finish_reason: Nullable[ChatCompletionFinishReason] finish_reason: Nullable[ChatCompletionFinishReason]
index: float index: float
@@ -67,3 +84,52 @@ class ChatResponseChoice(BaseModel):
m[k] = val m[k] = val
return m return m
class ChatStreamingChoiceTypedDict(TypedDict):
delta: ChatStreamingMessageChunkTypedDict
finish_reason: Nullable[ChatCompletionFinishReason]
index: float
logprobs: NotRequired[Nullable[ChatMessageTokenLogprobsTypedDict]]
class ChatStreamingChoice(BaseModel):
delta: ChatStreamingMessageChunk
finish_reason: Annotated[
Nullable[ChatCompletionFinishReason], PlainValidator(validate_open_enum(False))
]
index: float
logprobs: OptionalNullable[ChatMessageTokenLogprobs] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["logprobs"]
nullable_fields = ["finish_reason", "logprobs"]
null_default_fields = []
serialized = handler(self)
m = {}
for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k)
serialized.pop(k, None)
optional_nullable = k in optional_fields and k in nullable_fields
is_set = (
self.__pydantic_fields_set__.intersection({n})
or k in null_default_fields
) # pylint: disable=no-member
if val is not None and val != UNSET_SENTINEL:
m[k] = val
elif val != UNSET_SENTINEL and (
not k in optional_fields or (optional_nullable and is_set)
):
m[k] = val
return m
@@ -1,72 +0,0 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .chatcompletionfinishreason import ChatCompletionFinishReason
from .chatmessagetokenlogprobs import (
ChatMessageTokenLogprobs,
ChatMessageTokenLogprobsTypedDict,
)
from .chatstreamingmessagechunk import (
ChatStreamingMessageChunk,
ChatStreamingMessageChunkTypedDict,
)
from openrouter.types import (
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
)
from openrouter.utils import validate_open_enum
from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator
from typing_extensions import Annotated, NotRequired, TypedDict
class ChatStreamingChoiceTypedDict(TypedDict):
delta: ChatStreamingMessageChunkTypedDict
finish_reason: Nullable[ChatCompletionFinishReason]
index: float
logprobs: NotRequired[Nullable[ChatMessageTokenLogprobsTypedDict]]
class ChatStreamingChoice(BaseModel):
delta: ChatStreamingMessageChunk
finish_reason: Annotated[
Nullable[ChatCompletionFinishReason], PlainValidator(validate_open_enum(False))
]
index: float
logprobs: OptionalNullable[ChatMessageTokenLogprobs] = UNSET
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = ["logprobs"]
nullable_fields = ["finish_reason", "logprobs"]
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
@@ -5,7 +5,7 @@ from .chatgenerationtokenusage import (
ChatGenerationTokenUsage, ChatGenerationTokenUsage,
ChatGenerationTokenUsageTypedDict, ChatGenerationTokenUsageTypedDict,
) )
from .chatstreamingchoice import ChatStreamingChoice, ChatStreamingChoiceTypedDict from .chatresponsechoice import ChatStreamingChoice, ChatStreamingChoiceTypedDict
from openrouter.types import ( from openrouter.types import (
BaseModel, BaseModel,
Nullable, Nullable,
+5 -18
View File
@@ -2,19 +2,12 @@
from __future__ import annotations from __future__ import annotations
from .completionlogprobs import CompletionLogprobs, CompletionLogprobsTypedDict from .completionlogprobs import CompletionLogprobs, CompletionLogprobsTypedDict
from openrouter.types import ( from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL, UnrecognizedStr
BaseModel,
Nullable,
OptionalNullable,
UNSET,
UNSET_SENTINEL,
UnrecognizedStr,
)
from openrouter.utils import validate_open_enum from openrouter.utils import validate_open_enum
from pydantic import model_serializer from pydantic import model_serializer
from pydantic.functional_validators import PlainValidator from pydantic.functional_validators import PlainValidator
from typing import Literal, Optional, Union from typing import Literal, Union
from typing_extensions import Annotated, NotRequired, TypedDict from typing_extensions import Annotated, TypedDict
CompletionFinishReason = Union[ CompletionFinishReason = Union[
@@ -32,8 +25,6 @@ class CompletionChoiceTypedDict(TypedDict):
index: float index: float
logprobs: Nullable[CompletionLogprobsTypedDict] logprobs: Nullable[CompletionLogprobsTypedDict]
finish_reason: Nullable[CompletionFinishReason] finish_reason: Nullable[CompletionFinishReason]
native_finish_reason: NotRequired[str]
reasoning: NotRequired[Nullable[str]]
class CompletionChoice(BaseModel): class CompletionChoice(BaseModel):
@@ -47,14 +38,10 @@ class CompletionChoice(BaseModel):
Nullable[CompletionFinishReason], PlainValidator(validate_open_enum(False)) Nullable[CompletionFinishReason], PlainValidator(validate_open_enum(False))
] ]
native_finish_reason: Optional[str] = None
reasoning: OptionalNullable[str] = UNSET
@model_serializer(mode="wrap") @model_serializer(mode="wrap")
def serialize_model(self, handler): def serialize_model(self, handler):
optional_fields = ["native_finish_reason", "reasoning"] optional_fields = []
nullable_fields = ["logprobs", "finish_reason", "reasoning"] nullable_fields = ["logprobs", "finish_reason"]
null_default_fields = [] null_default_fields = []
serialized = handler(self) serialized = handler(self)
@@ -17,7 +17,6 @@ class CompletionResponseTypedDict(TypedDict):
model: str model: str
choices: List[CompletionChoiceTypedDict] choices: List[CompletionChoiceTypedDict]
object: Literal["text_completion"] object: Literal["text_completion"]
provider: NotRequired[str]
system_fingerprint: NotRequired[str] system_fingerprint: NotRequired[str]
usage: NotRequired[CompletionUsageTypedDict] usage: NotRequired[CompletionUsageTypedDict]
@@ -39,8 +38,6 @@ class CompletionResponse(BaseModel):
pydantic.Field(alias="object"), pydantic.Field(alias="object"),
] = "text_completion" ] = "text_completion"
provider: Optional[str] = None
system_fingerprint: Optional[str] = None system_fingerprint: Optional[str] = None
usage: Optional[CompletionUsage] = None usage: Optional[CompletionUsage] = None
@@ -44,10 +44,9 @@ from openrouter.types import (
UNSET_SENTINEL, UNSET_SENTINEL,
UnrecognizedStr, UnrecognizedStr,
) )
from openrouter.utils import get_discriminator, validate_const, validate_open_enum from openrouter.utils import get_discriminator, validate_open_enum
import pydantic
from pydantic import Discriminator, Tag, model_serializer from pydantic import Discriminator, Tag, model_serializer
from pydantic.functional_validators import AfterValidator, PlainValidator from pydantic.functional_validators import PlainValidator
from typing import Any, Dict, List, Literal, Optional, Union from typing import Any, Dict, List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
@@ -136,7 +135,16 @@ OpenResponsesRequestToolUnion = Annotated[
] ]
ServiceTier = Literal["auto",] ServiceTier = Union[
Literal[
"auto",
"default",
"flex",
"priority",
"scale",
],
UnrecognizedStr,
]
Truncation = Union[ Truncation = Union[
@@ -348,17 +356,6 @@ class Provider(BaseModel):
return m return m
IDResponseHealing = Literal["response-healing",]
class PluginResponseHealingTypedDict(TypedDict):
id: IDResponseHealing
class PluginResponseHealing(BaseModel):
id: IDResponseHealing
IDFileParser = Literal["file-parser",] IDFileParser = Literal["file-parser",]
@@ -440,12 +437,7 @@ class PluginModeration(BaseModel):
PluginTypedDict = TypeAliasType( PluginTypedDict = TypeAliasType(
"PluginTypedDict", "PluginTypedDict",
Union[ Union[PluginModerationTypedDict, PluginFileParserTypedDict, PluginWebTypedDict],
PluginModerationTypedDict,
PluginResponseHealingTypedDict,
PluginFileParserTypedDict,
PluginWebTypedDict,
],
) )
@@ -454,7 +446,6 @@ Plugin = Annotated[
Annotated[PluginModeration, Tag("moderation")], Annotated[PluginModeration, Tag("moderation")],
Annotated[PluginWeb, Tag("web")], Annotated[PluginWeb, Tag("web")],
Annotated[PluginFileParser, Tag("file-parser")], Annotated[PluginFileParser, Tag("file-parser")],
Annotated[PluginResponseHealing, Tag("response-healing")],
], ],
Discriminator(lambda m: get_discriminator(m, "id", "id")), Discriminator(lambda m: get_discriminator(m, "id", "id")),
] ]
@@ -487,8 +478,8 @@ class OpenResponsesRequestTypedDict(TypedDict):
include: NotRequired[Nullable[List[OpenAIResponsesIncludable]]] include: NotRequired[Nullable[List[OpenAIResponsesIncludable]]]
background: NotRequired[Nullable[bool]] background: NotRequired[Nullable[bool]]
safety_identifier: NotRequired[Nullable[str]] safety_identifier: NotRequired[Nullable[str]]
store: Literal[False] store: NotRequired[Nullable[bool]]
service_tier: NotRequired[ServiceTier] service_tier: NotRequired[Nullable[ServiceTier]]
truncation: NotRequired[Nullable[Truncation]] truncation: NotRequired[Nullable[Truncation]]
stream: NotRequired[bool] stream: NotRequired[bool]
provider: NotRequired[Nullable[ProviderTypedDict]] provider: NotRequired[Nullable[ProviderTypedDict]]
@@ -552,12 +543,11 @@ class OpenResponsesRequest(BaseModel):
safety_identifier: OptionalNullable[str] = UNSET safety_identifier: OptionalNullable[str] = UNSET
STORE: Annotated[ store: OptionalNullable[bool] = UNSET
Annotated[Optional[Literal[False]], AfterValidator(validate_const(False))],
pydantic.Field(alias="store"),
] = False
service_tier: Optional[ServiceTier] = "auto" service_tier: Annotated[
OptionalNullable[ServiceTier], PlainValidator(validate_open_enum(False))
] = UNSET
truncation: Annotated[ truncation: Annotated[
OptionalNullable[Truncation], PlainValidator(validate_open_enum(False)) OptionalNullable[Truncation], PlainValidator(validate_open_enum(False))
@@ -619,6 +609,8 @@ class OpenResponsesRequest(BaseModel):
"include", "include",
"background", "background",
"safety_identifier", "safety_identifier",
"store",
"service_tier",
"truncation", "truncation",
"provider", "provider",
] ]
+1 -5
View File
@@ -11,14 +11,12 @@ ProviderName = Union[
"AionLabs", "AionLabs",
"Alibaba", "Alibaba",
"Amazon Bedrock", "Amazon Bedrock",
"Amazon Nova",
"Anthropic", "Anthropic",
"Arcee AI", "Arcee",
"AtlasCloud", "AtlasCloud",
"Avian", "Avian",
"Azure", "Azure",
"BaseTen", "BaseTen",
"BytePlus",
"Black Forest Labs", "Black Forest Labs",
"Cerebras", "Cerebras",
"Chutes", "Chutes",
@@ -33,7 +31,6 @@ ProviderName = Union[
"Fireworks", "Fireworks",
"Friendli", "Friendli",
"GMICloud", "GMICloud",
"GoPomelo",
"Google", "Google",
"Google AI Studio", "Google AI Studio",
"Groq", "Groq",
@@ -64,7 +61,6 @@ ProviderName = Union[
"SambaNova", "SambaNova",
"SiliconFlow", "SiliconFlow",
"Stealth", "Stealth",
"StreamLake",
"Switchpoint", "Switchpoint",
"Targon", "Targon",
"Together", "Together",
+13
View File
@@ -0,0 +1,13 @@
"""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 VideoURLTypedDict(TypedDict):
url: str
class VideoURL(BaseModel):
url: str
+22 -4
View File
@@ -1,6 +1,7 @@
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from .basesdk import BaseSDK from .basesdk import BaseSDK
from enum import Enum
from openrouter import components, errors, operations, utils from openrouter import components, errors, operations, utils
from openrouter._hooks import HookContext from openrouter._hooks import HookContext
from openrouter.types import OptionalNullable, UNSET from openrouter.types import OptionalNullable, UNSET
@@ -9,6 +10,11 @@ from openrouter.utils.unmarshal_json_response import unmarshal_json_response
from typing import Any, Mapping, Optional, Union from typing import Any, Mapping, Optional, Union
class GenerateAcceptEnum(str, Enum):
APPLICATION_JSON = "application/json"
TEXT_EVENT_STREAM = "text/event-stream"
class Embeddings(BaseSDK): class Embeddings(BaseSDK):
r"""Text embedding endpoints""" r"""Text embedding endpoints"""
@@ -30,6 +36,7 @@ class Embeddings(BaseSDK):
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
accept_header_override: Optional[GenerateAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None, http_headers: Optional[Mapping[str, str]] = None,
) -> operations.CreateEmbeddingsResponse: ) -> operations.CreateEmbeddingsResponse:
r"""Submit an embedding request r"""Submit an embedding request
@@ -46,6 +53,7 @@ class Embeddings(BaseSDK):
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
:param accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests. :param http_headers: Additional headers to set or replace on requests.
""" """
base_url = None base_url = None
@@ -80,7 +88,9 @@ class Embeddings(BaseSDK):
request_has_path_params=False, request_has_path_params=False,
request_has_query_params=True, request_has_query_params=True,
user_agent_header="user-agent", user_agent_header="user-agent",
accept_header_value="application/json", accept_header_value=accept_header_override.value
if accept_header_override is not None
else "application/json;q=1, text/event-stream;q=0",
http_headers=http_headers, http_headers=http_headers,
security=self.sdk_configuration.security, security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body( get_serialized_body=lambda: utils.serialize_request_body(
@@ -129,8 +139,10 @@ class Embeddings(BaseSDK):
response_data: Any = None response_data: Any = None
if utils.match_response(http_res, "200", "application/json"): if utils.match_response(http_res, "200", "application/json"):
return unmarshal_json_response( return unmarshal_json_response(
operations.CreateEmbeddingsResponse, http_res operations.CreateEmbeddingsResponseBody, http_res
) )
if utils.match_response(http_res, "200", "text/event-stream"):
return http_res.text
if utils.match_response(http_res, "400", "application/json"): if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response( response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res errors.BadRequestResponseErrorData, http_res
@@ -212,6 +224,7 @@ class Embeddings(BaseSDK):
retries: OptionalNullable[utils.RetryConfig] = UNSET, retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None, server_url: Optional[str] = None,
timeout_ms: Optional[int] = None, timeout_ms: Optional[int] = None,
accept_header_override: Optional[GenerateAcceptEnum] = None,
http_headers: Optional[Mapping[str, str]] = None, http_headers: Optional[Mapping[str, str]] = None,
) -> operations.CreateEmbeddingsResponse: ) -> operations.CreateEmbeddingsResponse:
r"""Submit an embedding request r"""Submit an embedding request
@@ -228,6 +241,7 @@ class Embeddings(BaseSDK):
:param retries: Override the default retry configuration for this method :param retries: Override the default retry configuration for this method
:param server_url: Override the default server URL for this method :param server_url: Override the default server URL for this method
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
:param accept_header_override: Override the default accept header for this method
:param http_headers: Additional headers to set or replace on requests. :param http_headers: Additional headers to set or replace on requests.
""" """
base_url = None base_url = None
@@ -262,7 +276,9 @@ class Embeddings(BaseSDK):
request_has_path_params=False, request_has_path_params=False,
request_has_query_params=True, request_has_query_params=True,
user_agent_header="user-agent", user_agent_header="user-agent",
accept_header_value="application/json", accept_header_value=accept_header_override.value
if accept_header_override is not None
else "application/json;q=1, text/event-stream;q=0",
http_headers=http_headers, http_headers=http_headers,
security=self.sdk_configuration.security, security=self.sdk_configuration.security,
get_serialized_body=lambda: utils.serialize_request_body( get_serialized_body=lambda: utils.serialize_request_body(
@@ -311,8 +327,10 @@ class Embeddings(BaseSDK):
response_data: Any = None response_data: Any = None
if utils.match_response(http_res, "200", "application/json"): if utils.match_response(http_res, "200", "application/json"):
return unmarshal_json_response( return unmarshal_json_response(
operations.CreateEmbeddingsResponse, http_res operations.CreateEmbeddingsResponseBody, http_res
) )
if utils.match_response(http_res, "200", "text/event-stream"):
return http_res.text
if utils.match_response(http_res, "400", "application/json"): if utils.match_response(http_res, "400", "application/json"):
response_data = unmarshal_json_response( response_data = unmarshal_json_response(
errors.BadRequestResponseErrorData, http_res errors.BadRequestResponseErrorData, http_res
+7 -10
View File
@@ -45,6 +45,8 @@ if TYPE_CHECKING:
CreateEmbeddingsRequest, CreateEmbeddingsRequest,
CreateEmbeddingsRequestTypedDict, CreateEmbeddingsRequestTypedDict,
CreateEmbeddingsResponse, CreateEmbeddingsResponse,
CreateEmbeddingsResponseBody,
CreateEmbeddingsResponseBodyTypedDict,
CreateEmbeddingsResponseTypedDict, CreateEmbeddingsResponseTypedDict,
Embedding, Embedding,
EmbeddingTypedDict, EmbeddingTypedDict,
@@ -98,12 +100,7 @@ if TYPE_CHECKING:
ExchangeAuthCodeForAPIKeyResponse, ExchangeAuthCodeForAPIKeyResponse,
ExchangeAuthCodeForAPIKeyResponseTypedDict, ExchangeAuthCodeForAPIKeyResponseTypedDict,
) )
from .getcredits import ( from .getcredits import GetCreditsResponse, GetCreditsResponseTypedDict
GetCreditsData,
GetCreditsDataTypedDict,
GetCreditsResponse,
GetCreditsResponseTypedDict,
)
from .getcurrentkey import ( from .getcurrentkey import (
GetCurrentKeyData, GetCurrentKeyData,
GetCurrentKeyDataTypedDict, GetCurrentKeyDataTypedDict,
@@ -219,6 +216,8 @@ __all__ = [
"CreateEmbeddingsRequest", "CreateEmbeddingsRequest",
"CreateEmbeddingsRequestTypedDict", "CreateEmbeddingsRequestTypedDict",
"CreateEmbeddingsResponse", "CreateEmbeddingsResponse",
"CreateEmbeddingsResponseBody",
"CreateEmbeddingsResponseBodyTypedDict",
"CreateEmbeddingsResponseTypedDict", "CreateEmbeddingsResponseTypedDict",
"CreateKeysData", "CreateKeysData",
"CreateKeysDataTypedDict", "CreateKeysDataTypedDict",
@@ -243,8 +242,6 @@ __all__ = [
"ExchangeAuthCodeForAPIKeyRequestTypedDict", "ExchangeAuthCodeForAPIKeyRequestTypedDict",
"ExchangeAuthCodeForAPIKeyResponse", "ExchangeAuthCodeForAPIKeyResponse",
"ExchangeAuthCodeForAPIKeyResponseTypedDict", "ExchangeAuthCodeForAPIKeyResponseTypedDict",
"GetCreditsData",
"GetCreditsDataTypedDict",
"GetCreditsResponse", "GetCreditsResponse",
"GetCreditsResponseTypedDict", "GetCreditsResponseTypedDict",
"GetCurrentKeyData", "GetCurrentKeyData",
@@ -373,6 +370,8 @@ _dynamic_imports: dict[str, str] = {
"CreateEmbeddingsRequest": ".createembeddings", "CreateEmbeddingsRequest": ".createembeddings",
"CreateEmbeddingsRequestTypedDict": ".createembeddings", "CreateEmbeddingsRequestTypedDict": ".createembeddings",
"CreateEmbeddingsResponse": ".createembeddings", "CreateEmbeddingsResponse": ".createembeddings",
"CreateEmbeddingsResponseBody": ".createembeddings",
"CreateEmbeddingsResponseBodyTypedDict": ".createembeddings",
"CreateEmbeddingsResponseTypedDict": ".createembeddings", "CreateEmbeddingsResponseTypedDict": ".createembeddings",
"Embedding": ".createembeddings", "Embedding": ".createembeddings",
"EmbeddingTypedDict": ".createembeddings", "EmbeddingTypedDict": ".createembeddings",
@@ -417,8 +416,6 @@ _dynamic_imports: dict[str, str] = {
"ExchangeAuthCodeForAPIKeyRequestTypedDict": ".exchangeauthcodeforapikey", "ExchangeAuthCodeForAPIKeyRequestTypedDict": ".exchangeauthcodeforapikey",
"ExchangeAuthCodeForAPIKeyResponse": ".exchangeauthcodeforapikey", "ExchangeAuthCodeForAPIKeyResponse": ".exchangeauthcodeforapikey",
"ExchangeAuthCodeForAPIKeyResponseTypedDict": ".exchangeauthcodeforapikey", "ExchangeAuthCodeForAPIKeyResponseTypedDict": ".exchangeauthcodeforapikey",
"GetCreditsData": ".getcredits",
"GetCreditsDataTypedDict": ".getcredits",
"GetCreditsResponse": ".getcredits", "GetCreditsResponse": ".getcredits",
"GetCreditsResponseTypedDict": ".getcredits", "GetCreditsResponseTypedDict": ".getcredits",
"GetCurrentKeyData": ".getcurrentkey", "GetCurrentKeyData": ".getcurrentkey",
+13 -2
View File
@@ -395,7 +395,7 @@ class Usage(BaseModel):
cost: Optional[float] = None cost: Optional[float] = None
class CreateEmbeddingsResponseTypedDict(TypedDict): class CreateEmbeddingsResponseBodyTypedDict(TypedDict):
r"""Embedding response""" r"""Embedding response"""
object: Object object: Object
@@ -405,7 +405,7 @@ class CreateEmbeddingsResponseTypedDict(TypedDict):
usage: NotRequired[UsageTypedDict] usage: NotRequired[UsageTypedDict]
class CreateEmbeddingsResponse(BaseModel): class CreateEmbeddingsResponseBody(BaseModel):
r"""Embedding response""" r"""Embedding response"""
object: Object object: Object
@@ -417,3 +417,14 @@ class CreateEmbeddingsResponse(BaseModel):
id: Optional[str] = None id: Optional[str] = None
usage: Optional[Usage] = None usage: Optional[Usage] = None
CreateEmbeddingsResponseTypedDict = TypeAliasType(
"CreateEmbeddingsResponseTypedDict",
Union[CreateEmbeddingsResponseBodyTypedDict, str],
)
CreateEmbeddingsResponse = TypeAliasType(
"CreateEmbeddingsResponse", Union[CreateEmbeddingsResponseBody, str]
)
-19
View File
@@ -5,28 +5,9 @@ from openrouter.types import BaseModel
from typing_extensions import TypedDict from typing_extensions import TypedDict
class GetCreditsDataTypedDict(TypedDict):
total_credits: float
r"""Total credits purchased"""
total_usage: float
r"""Total credits used"""
class GetCreditsData(BaseModel):
total_credits: float
r"""Total credits purchased"""
total_usage: float
r"""Total credits used"""
class GetCreditsResponseTypedDict(TypedDict): class GetCreditsResponseTypedDict(TypedDict):
r"""Total credits purchased and used""" r"""Total credits purchased and used"""
data: GetCreditsDataTypedDict
class GetCreditsResponse(BaseModel): class GetCreditsResponse(BaseModel):
r"""Total credits purchased and used""" r"""Total credits purchased and used"""
data: GetCreditsData
+1 -5
View File
@@ -38,14 +38,12 @@ GetParametersProvider = Union[
"AionLabs", "AionLabs",
"Alibaba", "Alibaba",
"Amazon Bedrock", "Amazon Bedrock",
"Amazon Nova",
"Anthropic", "Anthropic",
"Arcee AI", "Arcee",
"AtlasCloud", "AtlasCloud",
"Avian", "Avian",
"Azure", "Azure",
"BaseTen", "BaseTen",
"BytePlus",
"Black Forest Labs", "Black Forest Labs",
"Cerebras", "Cerebras",
"Chutes", "Chutes",
@@ -60,7 +58,6 @@ GetParametersProvider = Union[
"Fireworks", "Fireworks",
"Friendli", "Friendli",
"GMICloud", "GMICloud",
"GoPomelo",
"Google", "Google",
"Google AI Studio", "Google AI Studio",
"Groq", "Groq",
@@ -91,7 +88,6 @@ GetParametersProvider = Union[
"SambaNova", "SambaNova",
"SiliconFlow", "SiliconFlow",
"Stealth", "Stealth",
"StreamLake",
"Switchpoint", "Switchpoint",
"Targon", "Targon",
"Together", "Together",
+2 -2
View File
@@ -105,7 +105,7 @@ class UpdateKeysRequestBody(BaseModel):
class UpdateKeysRequestTypedDict(TypedDict): class UpdateKeysRequestTypedDict(TypedDict):
hash: str hash: str
r"""The hash identifier of the API key to update""" r"""The hash identifier of the API key to update"""
body: UpdateKeysRequestBodyTypedDict request_body: UpdateKeysRequestBodyTypedDict
class UpdateKeysRequest(BaseModel): class UpdateKeysRequest(BaseModel):
@@ -114,7 +114,7 @@ class UpdateKeysRequest(BaseModel):
] ]
r"""The hash identifier of the API key to update""" r"""The hash identifier of the API key to update"""
body: Annotated[ request_body: Annotated[
UpdateKeysRequestBody, UpdateKeysRequestBody,
FieldMetadata(request=RequestMetadata(media_type="application/json")), FieldMetadata(request=RequestMetadata(media_type="application/json")),
] ]
+20 -6
View File
@@ -69,7 +69,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None, stream: Union[Literal[False], None] = None,
provider: OptionalNullable[ provider: OptionalNullable[
@@ -108,6 +109,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -172,7 +174,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True], stream: Literal[True],
provider: OptionalNullable[ provider: OptionalNullable[
@@ -211,6 +214,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -274,7 +278,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False, stream: Optional[bool] = False,
provider: OptionalNullable[ provider: OptionalNullable[
@@ -313,6 +318,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -368,6 +374,7 @@ class Responses(BaseSDK):
include=include, include=include,
background=background, background=background,
safety_identifier=safety_identifier, safety_identifier=safety_identifier,
store=store,
service_tier=service_tier, service_tier=service_tier,
truncation=truncation, truncation=truncation,
stream=stream, stream=stream,
@@ -620,7 +627,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Union[Literal[False], None] = None, stream: Union[Literal[False], None] = None,
provider: OptionalNullable[ provider: OptionalNullable[
@@ -659,6 +667,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -723,7 +732,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Literal[True], stream: Literal[True],
provider: OptionalNullable[ provider: OptionalNullable[
@@ -762,6 +772,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -825,7 +836,8 @@ class Responses(BaseSDK):
include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET, include: OptionalNullable[List[components.OpenAIResponsesIncludable]] = UNSET,
background: OptionalNullable[bool] = UNSET, background: OptionalNullable[bool] = UNSET,
safety_identifier: OptionalNullable[str] = UNSET, safety_identifier: OptionalNullable[str] = UNSET,
service_tier: Optional[components.ServiceTier] = "auto", store: OptionalNullable[bool] = UNSET,
service_tier: OptionalNullable[components.ServiceTier] = UNSET,
truncation: OptionalNullable[components.Truncation] = UNSET, truncation: OptionalNullable[components.Truncation] = UNSET,
stream: Optional[bool] = False, stream: Optional[bool] = False,
provider: OptionalNullable[ provider: OptionalNullable[
@@ -864,6 +876,7 @@ class Responses(BaseSDK):
:param include: :param include:
:param background: :param background:
:param safety_identifier: :param safety_identifier:
:param store:
:param service_tier: :param service_tier:
:param truncation: :param truncation:
:param stream: :param stream:
@@ -919,6 +932,7 @@ class Responses(BaseSDK):
include=include, include=include,
background=background, background=background,
safety_identifier=safety_identifier, safety_identifier=safety_identifier,
store=store,
service_tier=service_tier, service_tier=service_tier,
truncation=truncation, truncation=truncation,
stream=stream, stream=stream,