From 5f2c0ee2ea2882e0b73cdd73f509ec2222ab63ef Mon Sep 17 00:00:00 2001 From: OpenRouter Team Date: Wed, 21 Jan 2026 17:14:47 -0800 Subject: [PATCH] Project import generated by Copybara. GitOrigin-RevId: 2592bdc8b4b7c695a3d689390aedc9a42914acc8 --- .speakeasy/gen.lock | 297 +- .speakeasy/gen.yaml | 2 +- .speakeasy/in.openapi.yaml | 5069 +++++++++++++++- .speakeasy/out.openapi.yaml | 5077 ++++++++++++++++- .speakeasy/workflow.lock | 10 +- docs/components/assistantmessage.md | 4 +- .../assistantmessageimageurl.md} | 4 +- .../components/chatmessagecontentitemimage.md | 8 +- ...=> chatmessagecontentitemimageimageurl.md} | 2 +- docs/components/chatresponsechoice.md | 1 - docs/components/chatstreamingmessagechunk.md | 2 +- docs/components/image.md | 8 + docs/components/model.md | 3 +- docs/components/outputmodality.md | 3 +- docs/components/pricing.md | 1 + docs/components/publicendpoint.md | 1 + docs/components/publicpricing.md | 1 + docs/components/schema2.md | 23 + ...rypted.md => schema2reasoningencrypted.md} | 4 +- ...gsummary.md => schema2reasoningsummary.md} | 4 +- ...asoningtext.md => schema2reasoningtext.md} | 4 +- docs/components/schema3.md | 23 - docs/components/{schema5.md => schema4.md} | 2 +- .../bulkassignkeystoguardrailrequest.md | 9 + .../bulkassignkeystoguardrailrequestbody.md | 8 + .../bulkassignkeystoguardrailresponse.md | 10 + .../bulkassignmemberstoguardrailrequest.md | 9 + ...bulkassignmemberstoguardrailrequestbody.md | 8 + .../bulkassignmemberstoguardrailresponse.md | 10 + .../bulkunassignkeysfromguardrailrequest.md | 9 + ...ulkunassignkeysfromguardrailrequestbody.md | 8 + .../bulkunassignkeysfromguardrailresponse.md | 10 + ...bulkunassignmembersfromguardrailrequest.md | 9 + ...unassignmembersfromguardrailrequestbody.md | 8 + ...ulkunassignmembersfromguardrailresponse.md | 10 + docs/operations/category.md | 21 + docs/operations/createguardraildata.md | 19 + docs/operations/createguardrailrequest.md | 14 + .../createguardrailresetintervalrequest.md | 12 + .../createguardrailresetintervalresponse.md | 12 + docs/operations/createguardrailresponse.md | 10 + docs/operations/createkeysdata.md | 4 +- docs/operations/createkeysresponse.md | 8 +- docs/operations/deleteguardrailrequest.md | 8 + docs/operations/deleteguardrailresponse.md | 10 + docs/operations/deletekeysrequest.md | 6 +- docs/operations/getcurrentkeydata.md | 2 +- docs/operations/getcurrentkeyresponse.md | 6 +- docs/operations/getguardraildata.md | 19 + docs/operations/getguardrailrequest.md | 8 + docs/operations/getguardrailresetinterval.md | 12 + docs/operations/getguardrailresponse.md | 10 + docs/operations/getkeydata.md | 4 +- docs/operations/getkeyrequest.md | 6 +- docs/operations/getkeyresponse.md | 6 +- docs/operations/getmodelsrequest.md | 8 +- docs/operations/getparametersrequest.md | 10 - docs/operations/getparametersresponse.md | 10 - docs/operations/listdata.md | 4 +- .../listguardrailkeyassignmentsdata.md | 14 + .../listguardrailkeyassignmentsrequest.md | 10 + .../listguardrailkeyassignmentsresponse.md | 11 + .../listguardrailmemberassignmentsdata.md | 13 + .../listguardrailmemberassignmentsrequest.md | 10 + .../listguardrailmemberassignmentsresponse.md | 11 + docs/operations/listguardrailsdata.md | 17 + docs/operations/listguardrailsrequest.md | 9 + .../operations/listguardrailsresetinterval.md | 12 + ...etersdata.md => listguardrailsresponse.md} | 8 +- docs/operations/listkeyassignmentsdata.md | 14 + docs/operations/listkeyassignmentsrequest.md | 9 + docs/operations/listkeyassignmentsresponse.md | 11 + docs/operations/listmemberassignmentsdata.md | 13 + .../listmemberassignmentsrequest.md | 9 + .../listmemberassignmentsresponse.md | 11 + docs/operations/supportedparameter.md | 31 - docs/operations/updateguardraildata.md | 19 + docs/operations/updateguardrailrequest.md | 9 + docs/operations/updateguardrailrequestbody.md | 14 + .../updateguardrailresetintervalrequest.md | 12 + .../updateguardrailresetintervalresponse.md | 12 + docs/operations/updateguardrailresponse.md | 10 + docs/operations/updatekeysdata.md | 4 +- docs/operations/updatekeysrequest.md | 2 +- docs/operations/updatekeysresponse.md | 6 +- docs/sdks/analytics/README.md | 2 +- docs/sdks/apikeys/README.md | 34 +- docs/sdks/credits/README.md | 2 +- docs/sdks/guardrails/README.md | 617 ++ docs/sdks/models/README.md | 10 +- docs/sdks/parameters/README.md | 56 - output.zip | 0 pyproject.toml | 2 +- scripts/check_types.py | 97 + src/openrouter/_version.py | 4 +- src/openrouter/analytics.py | 4 +- src/openrouter/api_keys.py | 20 + src/openrouter/components/__init__.py | 80 +- .../components/{_schema3.py => _schema2.py} | 44 +- src/openrouter/components/assistantmessage.py | 33 +- .../components/chatmessagecontentitemimage.py | 8 +- .../components/chatresponsechoice.py | 7 +- .../components/chatstreamingmessagechunk.py | 6 +- src/openrouter/components/model.py | 8 +- src/openrouter/components/outputmodality.py | 1 + src/openrouter/components/publicendpoint.py | 10 + src/openrouter/components/publicpricing.py | 5 + src/openrouter/credits.py | 4 +- src/openrouter/guardrails.py | 3017 ++++++++++ src/openrouter/models_.py | 8 +- src/openrouter/operations/__init__.py | 311 +- .../operations/bulkassignkeystoguardrail.py | 49 + .../bulkassignmemberstoguardrail.py | 49 + .../bulkunassignkeysfromguardrail.py | 49 + .../bulkunassignmembersfromguardrail.py | 49 + src/openrouter/operations/createguardrail.py | 247 + src/openrouter/operations/deleteguardrail.py | 38 + src/openrouter/operations/getguardrail.py | 161 + src/openrouter/operations/getmodels.py | 33 +- src/openrouter/operations/getparameters.py | 123 - .../operations/listguardrailkeyassignments.py | 125 + .../listguardrailmemberassignments.py | 120 + src/openrouter/operations/listguardrails.py | 171 + .../operations/listkeyassignments.py | 118 + .../operations/listmemberassignments.py | 113 + src/openrouter/operations/updateguardrail.py | 271 + src/openrouter/parameters.py | 237 - src/openrouter/sdk.py | 8 +- src/openrouter/types/models.py | 378 ++ uv.lock | 155 +- 130 files changed, 16948 insertions(+), 1127 deletions(-) rename docs/{operations/getparameterssecurity.md => components/assistantmessageimageurl.md} (69%) rename docs/components/{imageurl.md => chatmessagecontentitemimageimageurl.md} (97%) create mode 100644 docs/components/image.md create mode 100644 docs/components/schema2.md rename docs/components/{schema3reasoningencrypted.md => schema2reasoningencrypted.md} (91%) rename docs/components/{schema3reasoningsummary.md => schema2reasoningsummary.md} (92%) rename docs/components/{schema3reasoningtext.md => schema2reasoningtext.md} (93%) delete mode 100644 docs/components/schema3.md rename docs/components/{schema5.md => schema4.md} (98%) create mode 100644 docs/operations/bulkassignkeystoguardrailrequest.md create mode 100644 docs/operations/bulkassignkeystoguardrailrequestbody.md create mode 100644 docs/operations/bulkassignkeystoguardrailresponse.md create mode 100644 docs/operations/bulkassignmemberstoguardrailrequest.md create mode 100644 docs/operations/bulkassignmemberstoguardrailrequestbody.md create mode 100644 docs/operations/bulkassignmemberstoguardrailresponse.md create mode 100644 docs/operations/bulkunassignkeysfromguardrailrequest.md create mode 100644 docs/operations/bulkunassignkeysfromguardrailrequestbody.md create mode 100644 docs/operations/bulkunassignkeysfromguardrailresponse.md create mode 100644 docs/operations/bulkunassignmembersfromguardrailrequest.md create mode 100644 docs/operations/bulkunassignmembersfromguardrailrequestbody.md create mode 100644 docs/operations/bulkunassignmembersfromguardrailresponse.md create mode 100644 docs/operations/category.md create mode 100644 docs/operations/createguardraildata.md create mode 100644 docs/operations/createguardrailrequest.md create mode 100644 docs/operations/createguardrailresetintervalrequest.md create mode 100644 docs/operations/createguardrailresetintervalresponse.md create mode 100644 docs/operations/createguardrailresponse.md create mode 100644 docs/operations/deleteguardrailrequest.md create mode 100644 docs/operations/deleteguardrailresponse.md create mode 100644 docs/operations/getguardraildata.md create mode 100644 docs/operations/getguardrailrequest.md create mode 100644 docs/operations/getguardrailresetinterval.md create mode 100644 docs/operations/getguardrailresponse.md delete mode 100644 docs/operations/getparametersrequest.md delete mode 100644 docs/operations/getparametersresponse.md create mode 100644 docs/operations/listguardrailkeyassignmentsdata.md create mode 100644 docs/operations/listguardrailkeyassignmentsrequest.md create mode 100644 docs/operations/listguardrailkeyassignmentsresponse.md create mode 100644 docs/operations/listguardrailmemberassignmentsdata.md create mode 100644 docs/operations/listguardrailmemberassignmentsrequest.md create mode 100644 docs/operations/listguardrailmemberassignmentsresponse.md create mode 100644 docs/operations/listguardrailsdata.md create mode 100644 docs/operations/listguardrailsrequest.md create mode 100644 docs/operations/listguardrailsresetinterval.md rename docs/operations/{getparametersdata.md => listguardrailsresponse.md} (53%) create mode 100644 docs/operations/listkeyassignmentsdata.md create mode 100644 docs/operations/listkeyassignmentsrequest.md create mode 100644 docs/operations/listkeyassignmentsresponse.md create mode 100644 docs/operations/listmemberassignmentsdata.md create mode 100644 docs/operations/listmemberassignmentsrequest.md create mode 100644 docs/operations/listmemberassignmentsresponse.md delete mode 100644 docs/operations/supportedparameter.md create mode 100644 docs/operations/updateguardraildata.md create mode 100644 docs/operations/updateguardrailrequest.md create mode 100644 docs/operations/updateguardrailrequestbody.md create mode 100644 docs/operations/updateguardrailresetintervalrequest.md create mode 100644 docs/operations/updateguardrailresetintervalresponse.md create mode 100644 docs/operations/updateguardrailresponse.md create mode 100644 docs/sdks/guardrails/README.md delete mode 100644 docs/sdks/parameters/README.md create mode 100644 output.zip create mode 100644 scripts/check_types.py rename src/openrouter/components/{_schema3.py => _schema2.py} (84%) create mode 100644 src/openrouter/guardrails.py create mode 100644 src/openrouter/operations/bulkassignkeystoguardrail.py create mode 100644 src/openrouter/operations/bulkassignmemberstoguardrail.py create mode 100644 src/openrouter/operations/bulkunassignkeysfromguardrail.py create mode 100644 src/openrouter/operations/bulkunassignmembersfromguardrail.py create mode 100644 src/openrouter/operations/createguardrail.py create mode 100644 src/openrouter/operations/deleteguardrail.py create mode 100644 src/openrouter/operations/getguardrail.py delete mode 100644 src/openrouter/operations/getparameters.py create mode 100644 src/openrouter/operations/listguardrailkeyassignments.py create mode 100644 src/openrouter/operations/listguardrailmemberassignments.py create mode 100644 src/openrouter/operations/listguardrails.py create mode 100644 src/openrouter/operations/listkeyassignments.py create mode 100644 src/openrouter/operations/listmemberassignments.py create mode 100644 src/openrouter/operations/updateguardrail.py delete mode 100644 src/openrouter/parameters.py create mode 100644 src/openrouter/types/models.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 07a85a3..1d3a900 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d management: - docChecksum: 331e8a1f7c97c6a4a6b57eaddc80fc39 + docChecksum: 7136b263714e485a5a96ee056b6e3f36 docVersion: 1.0.0 speakeasyVersion: 1.666.0 generationVersion: 2.768.0 - releaseVersion: 0.1.2 - configChecksum: adb2f19d89b3fd68d890e4bad6beebbf + releaseVersion: 0.1.3 + configChecksum: d03f8606816d7028a10e566c4ff2ac44 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true @@ -53,6 +53,7 @@ generatedFiles: - docs/components/architecture.md - docs/components/assistantmessage.md - docs/components/assistantmessagecontent.md + - docs/components/assistantmessageimageurl.md - docs/components/badgatewayresponseerrordata.md - docs/components/badrequestresponseerrordata.md - docs/components/chainid.md @@ -85,6 +86,7 @@ generatedFiles: - docs/components/chatmessagecontentitemcachecontrol.md - docs/components/chatmessagecontentitemimage.md - docs/components/chatmessagecontentitemimagedetail.md + - docs/components/chatmessagecontentitemimageimageurl.md - docs/components/chatmessagecontentitemtext.md - docs/components/chatmessagecontentitemvideo.md - docs/components/chatmessagecontentitemvideoinputvideo.md @@ -138,8 +140,8 @@ generatedFiles: - docs/components/idmoderation.md - docs/components/idresponsehealing.md - docs/components/idweb.md + - docs/components/image.md - docs/components/imagegenerationstatus.md - - docs/components/imageurl.md - docs/components/inputmodality.md - docs/components/inputtokensdetails.md - docs/components/instructtype.md @@ -437,11 +439,11 @@ generatedFiles: - docs/components/route.md - docs/components/schema0.md - docs/components/schema0enum.md - - docs/components/schema3.md - - docs/components/schema3reasoningencrypted.md - - docs/components/schema3reasoningsummary.md - - docs/components/schema3reasoningtext.md - - docs/components/schema5.md + - docs/components/schema2.md + - docs/components/schema2reasoningencrypted.md + - docs/components/schema2reasoningsummary.md + - docs/components/schema2reasoningtext.md + - docs/components/schema4.md - docs/components/security.md - docs/components/servicetier.md - docs/components/serviceunavailableresponseerrordata.md @@ -508,7 +510,20 @@ generatedFiles: - docs/models/internal/globals.md - docs/models/utils/retryconfig.md - docs/operations/apitype.md + - docs/operations/bulkassignkeystoguardrailrequest.md + - docs/operations/bulkassignkeystoguardrailrequestbody.md + - docs/operations/bulkassignkeystoguardrailresponse.md + - docs/operations/bulkassignmemberstoguardrailrequest.md + - docs/operations/bulkassignmemberstoguardrailrequestbody.md + - docs/operations/bulkassignmemberstoguardrailresponse.md + - docs/operations/bulkunassignkeysfromguardrailrequest.md + - docs/operations/bulkunassignkeysfromguardrailrequestbody.md + - docs/operations/bulkunassignkeysfromguardrailresponse.md + - docs/operations/bulkunassignmembersfromguardrailrequest.md + - docs/operations/bulkunassignmembersfromguardrailrequestbody.md + - docs/operations/bulkunassignmembersfromguardrailresponse.md - docs/operations/calldata.md + - docs/operations/category.md - docs/operations/content.md - docs/operations/contentimageurl.md - docs/operations/contenttext.md @@ -523,12 +538,19 @@ generatedFiles: - docs/operations/createembeddingsrequest.md - docs/operations/createembeddingsresponse.md - docs/operations/createembeddingsresponsebody.md + - docs/operations/createguardraildata.md + - docs/operations/createguardrailrequest.md + - docs/operations/createguardrailresetintervalrequest.md + - docs/operations/createguardrailresetintervalresponse.md + - docs/operations/createguardrailresponse.md - docs/operations/createkeysdata.md - docs/operations/createkeyslimitreset.md - docs/operations/createkeysrequest.md - docs/operations/createkeysresponse.md - docs/operations/createresponsesresponse.md - docs/operations/createresponsesresponsebody.md + - docs/operations/deleteguardrailrequest.md + - docs/operations/deleteguardrailresponse.md - docs/operations/deletekeysrequest.md - docs/operations/deletekeysresponse.md - docs/operations/embedding.md @@ -543,14 +565,14 @@ generatedFiles: - docs/operations/getgenerationdata.md - docs/operations/getgenerationrequest.md - docs/operations/getgenerationresponse.md + - docs/operations/getguardraildata.md + - docs/operations/getguardrailrequest.md + - docs/operations/getguardrailresetinterval.md + - docs/operations/getguardrailresponse.md - docs/operations/getkeydata.md - docs/operations/getkeyrequest.md - docs/operations/getkeyresponse.md - docs/operations/getmodelsrequest.md - - docs/operations/getparametersdata.md - - docs/operations/getparametersrequest.md - - docs/operations/getparametersresponse.md - - docs/operations/getparameterssecurity.md - docs/operations/getuseractivityrequest.md - docs/operations/getuseractivityresponse.md - docs/operations/imageurl.md @@ -560,6 +582,22 @@ generatedFiles: - docs/operations/listendpointsrequest.md - docs/operations/listendpointsresponse.md - docs/operations/listendpointszdrresponse.md + - docs/operations/listguardrailkeyassignmentsdata.md + - docs/operations/listguardrailkeyassignmentsrequest.md + - docs/operations/listguardrailkeyassignmentsresponse.md + - docs/operations/listguardrailmemberassignmentsdata.md + - docs/operations/listguardrailmemberassignmentsrequest.md + - docs/operations/listguardrailmemberassignmentsresponse.md + - docs/operations/listguardrailsdata.md + - docs/operations/listguardrailsrequest.md + - docs/operations/listguardrailsresetinterval.md + - docs/operations/listguardrailsresponse.md + - docs/operations/listkeyassignmentsdata.md + - docs/operations/listkeyassignmentsrequest.md + - docs/operations/listkeyassignmentsresponse.md + - docs/operations/listmemberassignmentsdata.md + - docs/operations/listmemberassignmentsrequest.md + - docs/operations/listmemberassignmentsresponse.md - docs/operations/listmodelsusersecurity.md - docs/operations/listprovidersdata.md - docs/operations/listprovidersresponse.md @@ -570,10 +608,15 @@ generatedFiles: - docs/operations/objectembedding.md - docs/operations/ratelimit.md - docs/operations/sendchatcompletionrequestresponse.md - - docs/operations/supportedparameter.md - docs/operations/transferintent.md - docs/operations/typeimageurl.md - docs/operations/typetext.md + - docs/operations/updateguardraildata.md + - docs/operations/updateguardrailrequest.md + - docs/operations/updateguardrailrequestbody.md + - docs/operations/updateguardrailresetintervalrequest.md + - docs/operations/updateguardrailresetintervalresponse.md + - docs/operations/updateguardrailresponse.md - docs/operations/updatekeysdata.md - docs/operations/updatekeyslimitreset.md - docs/operations/updatekeysrequest.md @@ -589,9 +632,9 @@ generatedFiles: - docs/sdks/embeddings/README.md - docs/sdks/endpoints/README.md - docs/sdks/generations/README.md + - docs/sdks/guardrails/README.md - docs/sdks/models/README.md - docs/sdks/oauth/README.md - - docs/sdks/parameters/README.md - docs/sdks/providers/README.md - docs/sdks/responses/README.md - py.typed @@ -611,7 +654,7 @@ generatedFiles: - src/openrouter/completions.py - src/openrouter/components/__init__.py - src/openrouter/components/_schema0.py - - src/openrouter/components/_schema3.py + - src/openrouter/components/_schema2.py - src/openrouter/components/activityitem.py - src/openrouter/components/assistantmessage.py - src/openrouter/components/badgatewayresponseerrordata.py @@ -793,6 +836,7 @@ generatedFiles: - src/openrouter/errors/unauthorizedresponse_error.py - src/openrouter/errors/unprocessableentityresponse_error.py - src/openrouter/generations.py + - src/openrouter/guardrails.py - src/openrouter/httpclient.py - src/openrouter/models/__init__.py - src/openrouter/models/internal/__init__.py @@ -800,28 +844,39 @@ generatedFiles: - src/openrouter/models_.py - src/openrouter/oauth.py - src/openrouter/operations/__init__.py + - src/openrouter/operations/bulkassignkeystoguardrail.py + - src/openrouter/operations/bulkassignmemberstoguardrail.py + - src/openrouter/operations/bulkunassignkeysfromguardrail.py + - src/openrouter/operations/bulkunassignmembersfromguardrail.py - src/openrouter/operations/createauthkeyscode.py - src/openrouter/operations/createcoinbasecharge.py - src/openrouter/operations/createembeddings.py + - src/openrouter/operations/createguardrail.py - src/openrouter/operations/createkeys.py - src/openrouter/operations/createresponses.py + - src/openrouter/operations/deleteguardrail.py - src/openrouter/operations/deletekeys.py - src/openrouter/operations/exchangeauthcodeforapikey.py - src/openrouter/operations/getcredits.py - src/openrouter/operations/getcurrentkey.py - src/openrouter/operations/getgeneration.py + - src/openrouter/operations/getguardrail.py - src/openrouter/operations/getkey.py - src/openrouter/operations/getmodels.py - - src/openrouter/operations/getparameters.py - src/openrouter/operations/getuseractivity.py - src/openrouter/operations/list.py - src/openrouter/operations/listendpoints.py - src/openrouter/operations/listendpointszdr.py + - src/openrouter/operations/listguardrailkeyassignments.py + - src/openrouter/operations/listguardrailmemberassignments.py + - src/openrouter/operations/listguardrails.py + - src/openrouter/operations/listkeyassignments.py + - src/openrouter/operations/listmemberassignments.py - src/openrouter/operations/listmodelsuser.py - src/openrouter/operations/listproviders.py - src/openrouter/operations/sendchatcompletionrequest.py + - src/openrouter/operations/updateguardrail.py - src/openrouter/operations/updatekeys.py - - src/openrouter/parameters.py - src/openrouter/providers.py - src/openrouter/py.typed - src/openrouter/responses.py @@ -1016,7 +1071,7 @@ examples: slug: "" responses: "200": - application/json: {"data": {"id": "openai/gpt-4", "name": "GPT-4", "created": 1692901234, "description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.", "architecture": {"tokenizer": "GPT", "instruct_type": "chatml", "modality": "text->text", "input_modalities": ["text"], "output_modalities": ["text"]}, "endpoints": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}}]}} + 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_id": "openai/gpt-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens", "frequency_penalty", "presence_penalty"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 0.25, "p75": 0.35, "p90": 0.48, "p99": 0.85}, "throughput_last_30m": {"p50": 45.2, "p75": 38.5, "p90": 28.3, "p99": 15.1}}]}} "404": application/json: {"error": {"code": 404, "message": "Resource not found"}} "500": @@ -1025,7 +1080,7 @@ examples: speakeasy-default-list-endpoints-zdr: responses: "200": - application/json: {"data": [{"name": "OpenAI: GPT-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}, "throughput_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}}]} + application/json: {"data": [{"name": "OpenAI: GPT-4", "model_id": "openai/gpt-4", "model_name": "GPT-4", "context_length": 8192, "pricing": {"prompt": "0.00003", "completion": "0.00006"}, "provider_name": "OpenAI", "tag": "openai", "quantization": "fp16", "max_completion_tokens": 4096, "max_prompt_tokens": 8192, "supported_parameters": ["temperature", "top_p", "max_tokens"], "uptime_last_30m": 99.5, "supports_implicit_caching": true, "latency_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}, "throughput_last_30m": {"p50": 25.5, "p75": 35.2, "p90": 48.7, "p99": 85.3}}]} "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} getParameters: @@ -1058,7 +1113,7 @@ examples: offset: "0" responses: "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"}]} + application/json: {"data": [{"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "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": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "429": @@ -1071,7 +1126,7 @@ examples: application/json: {"name": "My New API Key"} responses: "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}, "key": "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"} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "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": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -1084,12 +1139,12 @@ examples: speakeasy-default-update-keys: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" requestBody: application/json: {} responses: "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"}} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "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": application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} "401": @@ -1104,7 +1159,7 @@ examples: speakeasy-default-delete-keys: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" responses: "200": application/json: {"deleted": true} @@ -1120,10 +1175,10 @@ examples: speakeasy-default-get-key: parameters: path: - hash: "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" + hash: "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943" responses: "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"}} + application/json: {"data": {"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943", "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": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "404": @@ -1136,7 +1191,7 @@ examples: speakeasy-default-get-current-key: responses: "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, "rate_limit": {"requests": 1000, "interval": "1h", "note": "This field is deprecated and safe to ignore."}}} + application/json: {"data": {"label": "sk-or-v1-au7...890", "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": application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} "500": @@ -1189,4 +1244,190 @@ examples: application/json: {"error": {"code": "", "message": ""}} "500": application/json: {"error": {"code": "", "message": ""}} + listGuardrails: + speakeasy-default-list-guardrails: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Guardrail", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 1} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + createGuardrail: + speakeasy-default-create-guardrail: + requestBody: + application/json: {"name": "My New Guardrail"} + responses: + "201": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "My New Guardrail", "created_at": "2025-08-24T10:30:00Z"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + getGuardrail: + speakeasy-default-get-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Production Guardrail", "created_at": "2025-08-24T10:30:00Z"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + updateGuardrail: + speakeasy-default-update-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {} + responses: + "200": + application/json: {"data": {"id": "550e8400-e29b-41d4-a716-446655440000", "name": "Updated Guardrail Name", "created_at": "2025-08-24T10:30:00Z"}} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + deleteGuardrail: + speakeasy-default-delete-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"deleted": true} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listKeyAssignments: + speakeasy-default-list-key-assignments: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "key_hash": "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "key_name": "Production Key", "key_label": "prod-key", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 25} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listMemberAssignments: + speakeasy-default-list-member-assignments: + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "user_id": "user_abc123", "organization_id": "org_xyz789", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 10} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listGuardrailKeyAssignments: + speakeasy-default-list-guardrail-key-assignments: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": [], "total_count": 25} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + bulkAssignKeysToGuardrail: + speakeasy-default-bulk-assign-keys-to-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"key_hashes": ["c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"]} + responses: + "200": + application/json: {"assigned_count": 3} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + listGuardrailMemberAssignments: + speakeasy-default-list-guardrail-member-assignments: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + responses: + "200": + application/json: {"data": [{"id": "550e8400-e29b-41d4-a716-446655440000", "user_id": "user_abc123", "organization_id": "org_xyz789", "guardrail_id": "550e8400-e29b-41d4-a716-446655440001", "assigned_by": "user_abc123", "created_at": "2025-08-24T10:30:00Z"}], "total_count": 10} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + bulkAssignMembersToGuardrail: + speakeasy-default-bulk-assign-members-to-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"member_user_ids": ["user_abc123", "user_def456"]} + responses: + "200": + application/json: {"assigned_count": 2} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + bulkUnassignKeysFromGuardrail: + speakeasy-default-bulk-unassign-keys-from-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"key_hashes": ["c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"]} + responses: + "200": + application/json: {"unassigned_count": 3} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} + bulkUnassignMembersFromGuardrail: + speakeasy-default-bulk-unassign-members-from-guardrail: + parameters: + path: + id: "550e8400-e29b-41d4-a716-446655440000" + requestBody: + application/json: {"member_user_ids": ["user_abc123", "user_def456"]} + responses: + "200": + application/json: {"unassigned_count": 2} + "400": + application/json: {"error": {"code": 400, "message": "Invalid request parameters"}} + "401": + application/json: {"error": {"code": 401, "message": "Missing Authentication header"}} + "404": + application/json: {"error": {"code": 404, "message": "Resource not found"}} + "500": + application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 536b30c..81e4708 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -31,7 +31,7 @@ generation: skipResponseBodyAssertions: false preApplyUnionDiscriminators: true python: - version: 0.1.2 + version: 0.1.3 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index fb85a17..232f496 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -4102,6 +4102,3062 @@ components: properties: location: type: string + BaseAnthropicMessagesResponse: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + required: + - type + - error_code + required: + - type + - tool_use_id + - content + model: + type: string + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + - model_context_window_exceeded + stop_sequence: + type: string + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - server_tool_use + - service_tier + required: + - id + - type + - role + - content + - model + - stop_reason + - stop_sequence + - usage + AnthropicMessagesResponse: + allOf: + - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' + - type: object + properties: {} + description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions + example: + id: msg_01XFDUDYJgAACzvnptvVoYEL + type: message + role: assistant + content: + - type: text + text: Hello! I'm doing well, thank you for asking. + citations: null + model: claude-sonnet-4-5-20250929 + stop_reason: end_turn + stop_sequence: null + usage: + input_tokens: 12 + output_tokens: 15 + cache_creation_input_tokens: null + cache_read_input_tokens: null + cache_creation: null + server_tool_use: null + service_tier: standard + AnthropicMessagesStreamEvent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - message_start + message: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + required: + - type + - error_code + required: + - type + - tool_use_id + - content + model: + type: string + stop_reason: + nullable: true + stop_sequence: + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - server_tool_use + - service_tier + required: + - id + - type + - role + - content + - model + - stop_reason + - stop_sequence + - usage + required: + - type + - message + - type: object + properties: + type: + type: string + enum: + - message_delta + delta: + type: object + properties: + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + - model_context_window_exceeded + stop_sequence: + type: string + nullable: true + required: + - stop_reason + - stop_sequence + usage: + type: object + properties: + input_tokens: + type: number + nullable: true + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - server_tool_use + required: + - type + - delta + - usage + - type: object + properties: + type: + type: string + enum: + - message_stop + required: + - type + - type: object + properties: + type: + type: string + enum: + - content_block_start + index: + type: number + content_block: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + required: + - type + - error_code + required: + - type + - tool_use_id + - content + required: + - type + - index + - content_block + - type: object + properties: + type: + type: string + enum: + - content_block_delta + index: + type: number + delta: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text_delta + text: + type: string + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - input_json_delta + partial_json: + type: string + required: + - type + - partial_json + - type: object + properties: + type: + type: string + enum: + - thinking_delta + thinking: + type: string + required: + - type + - thinking + - type: object + properties: + type: + type: string + enum: + - signature_delta + signature: + type: string + required: + - type + - signature + - type: object + properties: + type: + type: string + enum: + - citations_delta + citation: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - citation + required: + - type + - index + - delta + - type: object + properties: + type: + type: string + enum: + - content_block_stop + index: + type: number + required: + - type + - index + - type: object + properties: + type: + type: string + enum: + - ping + required: + - type + - type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + description: Union of all possible streaming events + OpenRouterAnthropicMessageParam: + type: object + properties: + role: + type: string + enum: + - user + - assistant + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + - type: object + properties: + type: + type: string + enum: + - document + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - application/pdf + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - text + media_type: + type: string + enum: + - text/plain + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - content + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + required: + - type + - content + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + context: + type: string + nullable: true + title: + type: string + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - tool_result + tool_use_id: + type: string + content: + anyOf: + - type: string + - type: array + items: + anyOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + is_error: + type: boolean + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + title: + type: string + url: + type: string + page_age: + type: string + nullable: true + required: + - type + - encrypted_content + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + required: + - type + - error_code + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - tool_use_id + - content + - type: object + properties: + type: + type: string + enum: + - search_result + source: + type: string + title: + type: string + content: + type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + citations: + type: object + properties: + enabled: + type: boolean + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - source + - title + - content + required: + - role + - content + description: Anthropic message with OpenRouter extensions + AnthropicMessagesRequest: + type: object + properties: + model: + type: string + max_tokens: + type: number + messages: + type: array + items: + $ref: '#/components/schemas/OpenRouterAnthropicMessageParam' + system: + anyOf: + - type: string + - type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - text + metadata: + type: object + properties: + user_id: + type: string + nullable: true + stop_sequences: + type: array + items: + type: string + stream: + type: boolean + temperature: + type: number + top_p: + type: number + top_k: + type: number + tools: + type: array + items: + oneOf: + - type: object + properties: + name: + type: string + description: + type: string + input_schema: + type: object + properties: + type: + type: string + enum: + - object + properties: + nullable: true + required: + type: array + nullable: true + items: + type: string + required: + - type + additionalProperties: + nullable: true + type: + type: string + enum: + - custom + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - name + - input_schema + - type: object + properties: + type: + type: string + enum: + - bash_20250124 + name: + type: string + enum: + - bash + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - name + - type: object + properties: + type: + type: string + enum: + - text_editor_20250124 + name: + type: string + enum: + - str_replace_editor + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - name + - type: object + properties: + type: + type: string + enum: + - web_search_20250305 + name: + type: string + enum: + - web_search + allowed_domains: + type: array + nullable: true + items: + type: string + blocked_domains: + type: array + nullable: true + items: + type: string + max_uses: + type: number + nullable: true + user_location: + type: object + nullable: true + properties: + type: + type: string + enum: + - approximate + city: + type: string + nullable: true + country: + type: string + nullable: true + region: + type: string + nullable: true + timezone: + type: string + nullable: true + required: + - type + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + required: + - type + required: + - type + - name + tool_choice: + oneOf: + - type: object + properties: + type: + type: string + enum: + - auto + disable_parallel_tool_use: + type: boolean + required: + - type + - type: object + properties: + type: + type: string + enum: + - any + disable_parallel_tool_use: + type: boolean + required: + - type + - type: object + properties: + type: + type: string + enum: + - none + required: + - type + - type: object + properties: + type: + type: string + enum: + - tool + name: + type: string + disable_parallel_tool_use: + type: boolean + required: + - type + - name + thinking: + oneOf: + - type: object + properties: + type: + type: string + enum: + - enabled + budget_tokens: + type: number + required: + - type + - budget_tokens + - type: object + properties: + type: + type: string + enum: + - disabled + required: + - type + service_tier: + type: string + enum: + - auto + - standard_only + provider: + type: object + nullable: true + properties: + allow_fallbacks: + type: boolean + nullable: true + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use + the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + require_parameters: + type: boolean + nullable: true + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting + is omitted or set to false, then providers will receive only the parameters they support, and ignore the + rest. + data_collection: + $ref: '#/components/schemas/DataCollection' + zdr: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that + do not retain prompts will be used. + example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where + the author has allowed distillation will be used. + example: true + order: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of + this list that supports your requested model, and fall back to the next if it is unavailable. If no + providers are available, the request will fail with an error message. + only: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed + provider settings for this request. + ignore: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored + provider settings for this request. + quantizations: + type: array + nullable: true + items: + $ref: '#/components/schemas/Quantization' + description: A list of quantization levels to filter the provider by. + sort: + allOf: + - $ref: '#/components/schemas/ProviderSort' + - anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load + balancing is performed. + max_price: + type: object + properties: + prompt: + $ref: '#/components/schemas/BigNumberUnion' + completion: + $ref: '#/components/schemas/BigNumberUnion' + image: + $ref: '#/components/schemas/BigNumberUnion' + audio: + $ref: '#/components/schemas/BigNumberUnion' + request: + $ref: '#/components/schemas/BigNumberUnion' + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, + for prompt and completion. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' + additionalProperties: false + description: When multiple model providers are available, optionally indicate your routing preference. + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + enum: + - auto-router + enabled: + type: boolean + description: Set to false to disable the auto-router plugin for this request. Defaults to true. + allowed_models: + type: array + items: + type: string + description: >- + List of model patterns to filter which models the auto-router can route between. Supports + wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default + supported models list. + example: + - anthropic/* + - openai/gpt-4o + - google/* + required: + - id + - type: object + properties: + id: + type: string + enum: + - moderation + required: + - id + - type: object + properties: + id: + type: string + enum: + - web + enabled: + type: boolean + description: Set to false to disable the web-search plugin for this request. Defaults to true. + max_results: + type: number + search_prompt: + type: string + engine: + $ref: '#/components/schemas/WebSearchEngine' + required: + - id + - type: object + properties: + id: + type: string + enum: + - file-parser + enabled: + type: boolean + description: Set to false to disable the file-parser plugin for this request. Defaults to true. + pdf: + $ref: '#/components/schemas/PDFParserOptions' + required: + - id + - type: object + properties: + id: + type: string + enum: + - response-healing + enabled: + type: boolean + description: Set to false to disable the response-healing plugin for this request. Defaults to true. + required: + - id + description: Plugins you want to enable for this request, including their settings. + route: + type: string + nullable: true + enum: + - fallback + - sort + deprecated: true + description: >- + **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for + providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). + x-speakeasy-deprecation-message: Use providers.sort.partition instead. + x-speakeasy-ignore: true + x-fern-ignore: true + user: + type: string + maxLength: 128 + description: >- + A unique identifier representing your end-user, which helps distinguish between different users of your app. + This allows your app to identify specific users in case of abuse reports, preventing your entire app from + being affected by the actions of individual users. Maximum of 128 characters. + session_id: + type: string + maxLength: 128 + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for + observability. If provided in both the request body and the x-session-id header, the body value takes + precedence. Maximum of 128 characters. + models: + type: array + items: + type: string + required: + - model + - max_tokens + - messages + description: Request schema for Anthropic Messages API endpoint + example: + model: anthropic/claude-4.5-sonnet-20250929 + max_tokens: 1024 + messages: + - role: user + content: Hello, how are you? + temperature: 0.7 ActivityItem: type: object properties: @@ -4349,6 +7405,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' audio: $ref: '#/components/schemas/BigNumberUnion' + audio_output: + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: $ref: '#/components/schemas/BigNumberUnion' web_search: @@ -4410,6 +7468,7 @@ components: - text - image - embeddings + - audio example: text ModelArchitecture: type: object @@ -4616,6 +7675,11 @@ components: description: List of supported parameters for this model default_parameters: $ref: '#/components/schemas/DefaultParameters' + expiration_date: + type: string + nullable: true + description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + example: '2025-06-01' required: - id - canonical_slug @@ -4659,6 +7723,7 @@ components: - top_p - max_tokens default_parameters: null + expiration_date: null ModelsListResponseData: type: array items: @@ -4705,6 +7770,7 @@ components: - frequency_penalty - presence_penalty default_parameters: null + expiration_date: null ModelsCountResponse: type: object properties: @@ -4796,6 +7862,10 @@ components: properties: name: type: string + model_id: + type: string + description: The unique identifier for the model (permaslug) + example: openai/gpt-4 model_name: type: string context_length: @@ -4817,6 +7887,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' audio: $ref: '#/components/schemas/BigNumberUnion' + audio_output: + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: $ref: '#/components/schemas/BigNumberUnion' web_search: @@ -4869,6 +7941,7 @@ components: unauthenticated requests. required: - name + - model_id - model_name - context_length - pricing @@ -4885,6 +7958,7 @@ components: description: Information about a specific model endpoint example: name: 'OpenAI: GPT-4' + model_id: openai/gpt-4 model_name: GPT-4 context_length: 8192 pricing: @@ -5110,10 +8184,6 @@ components: - type: string - type: number __schema2: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' - __schema3: oneOf: - type: object properties: @@ -5123,11 +8193,11 @@ components: summary: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - summary @@ -5139,11 +8209,11 @@ components: data: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - data @@ -5161,19 +8231,19 @@ components: - type: string - type: 'null' id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type type: object - __schema4: + __schema3: anyOf: - type: string - type: 'null' - __schema5: + __schema4: anyOf: - type: string enum: @@ -5184,8 +8254,12 @@ components: - anthropic-claude-v1 - google-gemini-v1 - type: 'null' - __schema6: + __schema5: type: number + __schema6: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -5538,6 +8612,24 @@ components: anyOf: - type: string - type: 'null' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema2' + images: + type: array + items: + type: object + properties: + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - image_url required: - role ToolResponseMessage: @@ -6069,15 +9161,11 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number message: $ref: '#/components/schemas/AssistantMessage' - reasoning_details: - type: array - items: - $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -6131,14 +9219,14 @@ components: reasoning_details: type: array items: - $ref: '#/components/schemas/__schema3' + $ref: '#/components/schemas/__schema2' ChatStreamingChoice: type: object properties: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number logprobs: @@ -6630,13 +9718,244 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' operationId: createResponses + /messages: + post: + x-speakeasy-ignore: true + x-speakeasy-name-override: create + x-speakeasy-stream-request-field: stream + tags: + - anthropic.messages + summary: Create a message + description: >- + Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended + thinking. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnthropicMessagesRequest' + required: true + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/AnthropicMessagesResponse' + text/event-stream: + schema: + type: object + properties: + event: + type: string + data: + $ref: '#/components/schemas/AnthropicMessagesStreamEvent' + required: + - event + - data + x-speakeasy-sse-sentinel: '[DONE]' + '400': + description: Invalid request error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '401': + description: Authentication error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '403': + description: Permission denied error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '404': + description: Not found error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '429': + description: Rate limit error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '500': + description: API error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '503': + description: Overloaded error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '529': + description: Overloaded error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + operationId: createMessages /activity: get: tags: - Analytics operationId: getUserActivity summary: Get user activity grouped by endpoint - description: Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + description: >- + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -6705,7 +10024,9 @@ paths: - Credits summary: Get remaining credits operationId: getCredits - description: Get total credits purchased and used for the authenticated user + description: >- + Get total credits purchased and used for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. responses: '200': description: Returns the total credits purchased and used @@ -7407,7 +10728,23 @@ paths: parameters: - schema: type: string + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + description: Filter models by use case category + example: programming required: false + description: Filter models by use case category name: category in: query - schema: @@ -7545,116 +10882,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' operationId: listEndpointsZdr - /parameters/{author}/{slug}: - get: - tags: - - Parameters - summary: Get a model's supported parameters and data about which are most popular - security: - - bearer: [] - parameters: - - schema: - type: string - required: true - name: author - in: path - - schema: - type: string - required: true - name: slug - in: path - - schema: - $ref: '#/components/schemas/ProviderName' - required: false - name: provider - in: query - responses: - '200': - description: Returns the parameters for the specified model - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - model: - type: string - description: Model identifier - example: openai/gpt-4 - supported_parameters: - type: array - items: - type: string - enum: - - temperature - - top_p - - top_k - - min_p - - top_a - - frequency_penalty - - presence_penalty - - repetition_penalty - - max_tokens - - logit_bias - - logprobs - - top_logprobs - - seed - - response_format - - structured_outputs - - stop - - tools - - tool_choice - - parallel_tool_calls - - include_reasoning - - reasoning - - reasoning_effort - - web_search_options - - verbosity - description: List of parameters supported by this model - example: - - temperature - - top_p - - max_tokens - required: - - model - - supported_parameters - example: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - description: Parameter analytics data - required: - - data - example: - data: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - '401': - description: Unauthorized - Authentication required or invalid credentials - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - '404': - description: Not Found - Model or provider does not exist - content: - application/json: - schema: - $ref: '#/components/schemas/NotFoundResponse' - '500': - description: Internal Server Error - Unexpected server error - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerResponse' - operationId: getParameters /providers: get: tags: @@ -7723,6 +10950,9 @@ paths: tags: - API Keys summary: List API keys + description: >- + List all API keys for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -7756,7 +10986,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7764,7 +10994,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -7855,9 +11085,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -7879,7 +11109,7 @@ paths: - data example: data: - - hash: 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 + - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -7921,6 +11151,9 @@ paths: tags: - API Keys summary: Create a new API key + description: >- + Create a new API key for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. requestBody: content: application/json: @@ -7983,7 +11216,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7991,7 +11224,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8082,9 +11315,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8111,7 +11344,7 @@ paths: - key example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My New API Key label: My New API Key disabled: false @@ -8162,11 +11395,12 @@ paths: tags: - API Keys summary: Update an API key + description: Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to update - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to update name: hash @@ -8226,7 +11460,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8234,7 +11468,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8325,9 +11559,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8349,7 +11583,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: Updated API Key Name label: Updated API Key Name disabled: false @@ -8404,11 +11638,12 @@ paths: tags: - API Keys summary: Delete an API key + description: Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to delete - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to delete name: hash @@ -8461,11 +11696,12 @@ paths: tags: - API Keys summary: Get a single API key + description: Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to retrieve - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to retrieve name: hash @@ -8484,7 +11720,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8492,7 +11728,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8583,9 +11819,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8607,7 +11843,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -8650,6 +11886,1511 @@ paths: application/json: schema: $ref: '#/components/schemas/InternalServerResponse' + /guardrails: + get: + operationId: listGuardrails + x-speakeasy-name-override: list + tags: + - Guardrails + summary: List guardrails + description: >- + List all guardrails for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of guardrails + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: List of guardrails + total_count: + type: number + description: Total number of guardrails + example: 25 + required: + - data + - total_count + example: + data: + - id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: createGuardrail + x-speakeasy-name-override: create + tags: + - Guardrails + summary: Create a guardrail + description: >- + Create a new guardrail for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: Name for the new guardrail + example: My New Guardrail + description: + type: string + nullable: true + maxLength: 1000 + description: Description of the guardrail + example: A guardrail for limiting API usage + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 50 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + required: + - name + example: + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - deepseek + allowed_models: null + enforce_zdr: false + required: true + responses: + '201': + description: Guardrail created successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The created guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: null + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}: + get: + operationId: getGuardrail + x-speakeasy-name-override: get + tags: + - Guardrails + summary: Get a guardrail + description: Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to retrieve + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to retrieve + name: id + in: path + responses: + '200': + description: Guardrail details + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + patch: + operationId: updateGuardrail + x-speakeasy-name-override: update + tags: + - Guardrails + summary: Update a guardrail + description: Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to update + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to update + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: New name for the guardrail + example: Updated Guardrail Name + description: + type: string + nullable: true + maxLength: 1000 + description: New description for the guardrail + example: Updated description + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: New spending limit in USD + example: 75 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: New list of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: true + example: + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + required: true + responses: + '200': + description: Guardrail updated successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The updated guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + allowed_providers: + - openai + allowed_models: null + enforce_zdr: true + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T16:00:00Z' + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + delete: + operationId: deleteGuardrail + x-speakeasy-name-override: delete + tags: + - Guardrails + summary: Delete a guardrail + description: Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to delete + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to delete + name: id + in: path + responses: + '200': + description: Guardrail deleted successfully + content: + application/json: + schema: + type: object + properties: + deleted: + type: boolean + const: true + description: Confirmation that the guardrail was deleted + example: true + required: + - deleted + example: + deleted: true + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/keys: + get: + operationId: listKeyAssignments + x-speakeasy-name-override: listKeyAssignments + tags: + - Guardrails + summary: List all key assignments + description: >- + List all API key guardrail assignments for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/members: + get: + operationId: listMemberAssignments + x-speakeasy-name-override: listMemberAssignments + tags: + - Guardrails + summary: List all member assignments + description: >- + List all organization member guardrail assignments for the authenticated user. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys: + get: + operationId: listGuardrailKeyAssignments + x-speakeasy-name-override: listGuardrailKeyAssignments + tags: + - Guardrails + summary: List key assignments for a guardrail + description: >- + List all API key assignments for a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignKeysToGuardrail + x-speakeasy-name-override: bulkAssignKeys + tags: + - Guardrails + summary: Bulk assign keys to a guardrail + description: >- + Assign multiple API keys to a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to assign to the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of keys successfully assigned + example: 3 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members: + get: + operationId: listGuardrailMemberAssignments + x-speakeasy-name-override: listGuardrailMemberAssignments + tags: + - Guardrails + summary: List member assignments for a guardrail + description: >- + List all organization member assignments for a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignMembersToGuardrail + x-speakeasy-name-override: bulkAssignMembers + tags: + - Guardrails + summary: Bulk assign members to a guardrail + description: >- + Assign multiple organization members to a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to assign to the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of members successfully assigned + example: 2 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys/remove: + post: + operationId: bulkUnassignKeysFromGuardrail + x-speakeasy-name-override: bulkUnassignKeys + tags: + - Guardrails + summary: Bulk unassign keys from a guardrail + description: >- + Unassign multiple API keys from a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to unassign from the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of keys successfully unassigned + example: 3 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members/remove: + post: + operationId: bulkUnassignMembersFromGuardrail + x-speakeasy-name-override: bulkUnassignMembers + tags: + - Guardrails + summary: Bulk unassign members from a guardrail + description: >- + Unassign multiple organization members from a specific guardrail. [Provisioning + key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to unassign from the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of members successfully unassigned + example: 2 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' /key: get: operationId: getCurrentKey @@ -8672,7 +13413,7 @@ paths: label: type: string description: Human-readable label for the API key - example: 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 + example: sk-or-v1-0e6...1c96 limit: type: number nullable: true @@ -8782,7 +13523,7 @@ paths: - rate_limit description: Current API key information example: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -8806,7 +13547,7 @@ paths: - data example: data: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -9146,14 +13887,16 @@ tags: description: Endpoint information - name: Generations description: Generation history endpoints + - name: Guardrails + description: Guardrails endpoints - name: Models description: Model information endpoints - name: OAuth description: OAuth authentication endpoints - - name: Parameters - description: Parameters endpoints - name: Providers description: Provider information endpoints + - name: anthropic.messages + description: anthropic.messages endpoints - name: beta.responses description: beta.responses endpoints x-fern-base-path: / diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 8b99f5c..e183d3f 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -4105,6 +4105,3077 @@ components: properties: location: type: string + BaseAnthropicMessagesResponse: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + x-speakeasy-unknown-values: allow + required: + - type + - error_code + required: + - type + - tool_use_id + - content + model: + type: string + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + - model_context_window_exceeded + x-speakeasy-unknown-values: allow + stop_sequence: + type: string + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + x-speakeasy-unknown-values: allow + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - server_tool_use + - service_tier + required: + - id + - type + - role + - content + - model + - stop_reason + - stop_sequence + - usage + AnthropicMessagesResponse: + allOf: + - $ref: '#/components/schemas/BaseAnthropicMessagesResponse' + - type: object + properties: {} + description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions + example: + id: msg_01XFDUDYJgAACzvnptvVoYEL + type: message + role: assistant + content: + - type: text + text: Hello! I'm doing well, thank you for asking. + citations: null + model: claude-sonnet-4-5-20250929 + stop_reason: end_turn + stop_sequence: null + usage: + input_tokens: 12 + output_tokens: 15 + cache_creation_input_tokens: null + cache_read_input_tokens: null + cache_creation: null + server_tool_use: null + service_tier: standard + AnthropicMessagesStreamEvent: + oneOf: + - type: object + properties: + type: + type: string + enum: + - message_start + message: + type: object + properties: + id: + type: string + type: + type: string + enum: + - message + role: + type: string + enum: + - assistant + content: + type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + x-speakeasy-unknown-values: allow + required: + - type + - error_code + required: + - type + - tool_use_id + - content + model: + type: string + stop_reason: + nullable: true + stop_sequence: + nullable: true + usage: + type: object + properties: + input_tokens: + type: number + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + cache_creation: + type: object + nullable: true + properties: + ephemeral_5m_input_tokens: + type: number + ephemeral_1h_input_tokens: + type: number + required: + - ephemeral_5m_input_tokens + - ephemeral_1h_input_tokens + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + service_tier: + type: string + nullable: true + enum: + - standard + - priority + - batch + x-speakeasy-unknown-values: allow + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - cache_creation + - server_tool_use + - service_tier + required: + - id + - type + - role + - content + - model + - stop_reason + - stop_sequence + - usage + required: + - type + - message + - type: object + properties: + type: + type: string + enum: + - message_delta + delta: + type: object + properties: + stop_reason: + type: string + nullable: true + enum: + - end_turn + - max_tokens + - stop_sequence + - tool_use + - pause_turn + - refusal + - model_context_window_exceeded + x-speakeasy-unknown-values: allow + stop_sequence: + type: string + nullable: true + required: + - stop_reason + - stop_sequence + usage: + type: object + properties: + input_tokens: + type: number + nullable: true + output_tokens: + type: number + cache_creation_input_tokens: + type: number + nullable: true + cache_read_input_tokens: + type: number + nullable: true + server_tool_use: + type: object + nullable: true + properties: + web_search_requests: + type: number + required: + - web_search_requests + required: + - input_tokens + - output_tokens + - cache_creation_input_tokens + - cache_read_input_tokens + - server_tool_use + required: + - type + - delta + - usage + - type: object + properties: + type: + type: string + enum: + - message_stop + required: + - type + - type: object + properties: + type: + type: string + enum: + - content_block_start + index: + type: number + content_block: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - text + - citations + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + page_age: + type: string + nullable: true + title: + type: string + url: + type: string + required: + - type + - encrypted_content + - page_age + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + x-speakeasy-unknown-values: allow + required: + - type + - error_code + required: + - type + - tool_use_id + - content + required: + - type + - index + - content_block + - type: object + properties: + type: + type: string + enum: + - content_block_delta + index: + type: number + delta: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text_delta + text: + type: string + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - input_json_delta + partial_json: + type: string + required: + - type + - partial_json + - type: object + properties: + type: + type: string + enum: + - thinking_delta + thinking: + type: string + required: + - type + - thinking + - type: object + properties: + type: + type: string + enum: + - signature_delta + signature: + type: string + required: + - type + - signature + - type: object + properties: + type: + type: string + enum: + - citations_delta + citation: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - file_id + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - file_id + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + file_id: + type: string + nullable: true + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - file_id + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + required: + - type + - citation + required: + - type + - index + - delta + - type: object + properties: + type: + type: string + enum: + - content_block_stop + index: + type: number + required: + - type + - index + - type: object + properties: + type: + type: string + enum: + - ping + required: + - type + - type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + description: Union of all possible streaming events + OpenRouterAnthropicMessageParam: + type: object + properties: + role: + type: string + enum: + - user + - assistant + x-speakeasy-unknown-values: allow + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + x-speakeasy-unknown-values: allow + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + - type: object + properties: + type: + type: string + enum: + - document + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - application/pdf + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - text + media_type: + type: string + enum: + - text/plain + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - content + content: + anyOf: + - type: string + - type: array + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + x-speakeasy-unknown-values: allow + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + required: + - type + - content + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + citations: + type: object + nullable: true + properties: + enabled: + type: boolean + context: + type: string + nullable: true + title: + type: string + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + - type: object + properties: + type: + type: string + enum: + - tool_use + id: + type: string + name: + type: string + input: + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - tool_result + tool_use_id: + type: string + content: + anyOf: + - type: string + - type: array + items: + anyOf: + - type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + - type: object + properties: + type: + type: string + enum: + - image + source: + oneOf: + - type: object + properties: + type: + type: string + enum: + - base64 + media_type: + type: string + enum: + - image/jpeg + - image/png + - image/gif + - image/webp + x-speakeasy-unknown-values: allow + data: + type: string + required: + - type + - media_type + - data + - type: object + properties: + type: + type: string + enum: + - url + url: + type: string + required: + - type + - url + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + is_error: + type: boolean + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - tool_use_id + - type: object + properties: + type: + type: string + enum: + - thinking + thinking: + type: string + signature: + type: string + required: + - type + - thinking + - signature + - type: object + properties: + type: + type: string + enum: + - redacted_thinking + data: + type: string + required: + - type + - data + - type: object + properties: + type: + type: string + enum: + - server_tool_use + id: + type: string + name: + type: string + enum: + - web_search + input: + nullable: true + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - id + - name + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result + tool_use_id: + type: string + content: + anyOf: + - type: array + items: + type: object + properties: + type: + type: string + enum: + - web_search_result + encrypted_content: + type: string + title: + type: string + url: + type: string + page_age: + type: string + nullable: true + required: + - type + - encrypted_content + - title + - url + - type: object + properties: + type: + type: string + enum: + - web_search_tool_result_error + error_code: + type: string + enum: + - invalid_tool_input + - unavailable + - max_uses_exceeded + - too_many_requests + - query_too_long + x-speakeasy-unknown-values: allow + required: + - type + - error_code + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - tool_use_id + - content + - type: object + properties: + type: + type: string + enum: + - search_result + source: + type: string + title: + type: string + content: + type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + citations: + type: object + properties: + enabled: + type: boolean + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - source + - title + - content + required: + - role + - content + description: Anthropic message with OpenRouter extensions + AnthropicMessagesRequest: + type: object + properties: + model: + type: string + max_tokens: + type: number + messages: + type: array + items: + $ref: '#/components/schemas/OpenRouterAnthropicMessageParam' + system: + anyOf: + - type: string + - type: array + items: + type: object + properties: + type: + type: string + enum: + - text + text: + type: string + citations: + type: array + nullable: true + items: + oneOf: + - type: object + properties: + type: + type: string + enum: + - char_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_char_index: + type: number + end_char_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_char_index + - end_char_index + - type: object + properties: + type: + type: string + enum: + - page_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_page_number: + type: number + end_page_number: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_page_number + - end_page_number + - type: object + properties: + type: + type: string + enum: + - content_block_location + cited_text: + type: string + document_index: + type: number + document_title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - document_index + - document_title + - start_block_index + - end_block_index + - type: object + properties: + type: + type: string + enum: + - web_search_result_location + cited_text: + type: string + encrypted_index: + type: string + title: + type: string + nullable: true + url: + type: string + required: + - type + - cited_text + - encrypted_index + - title + - url + - type: object + properties: + type: + type: string + enum: + - search_result_location + cited_text: + type: string + search_result_index: + type: number + source: + type: string + title: + type: string + nullable: true + start_block_index: + type: number + end_block_index: + type: number + required: + - type + - cited_text + - search_result_index + - source + - title + - start_block_index + - end_block_index + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - text + metadata: + type: object + properties: + user_id: + type: string + nullable: true + stop_sequences: + type: array + items: + type: string + stream: + type: boolean + temperature: + type: number + top_p: + type: number + top_k: + type: number + tools: + type: array + items: + oneOf: + - type: object + properties: + name: + type: string + description: + type: string + input_schema: + type: object + properties: + type: + type: string + enum: + - object + properties: + nullable: true + required: + type: array + nullable: true + items: + type: string + required: + - type + additionalProperties: + nullable: true + type: + type: string + enum: + - custom + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - name + - input_schema + - type: object + properties: + type: + type: string + enum: + - bash_20250124 + name: + type: string + enum: + - bash + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - name + - type: object + properties: + type: + type: string + enum: + - text_editor_20250124 + name: + type: string + enum: + - str_replace_editor + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - name + - type: object + properties: + type: + type: string + enum: + - web_search_20250305 + name: + type: string + enum: + - web_search + allowed_domains: + type: array + nullable: true + items: + type: string + blocked_domains: + type: array + nullable: true + items: + type: string + max_uses: + type: number + nullable: true + user_location: + type: object + nullable: true + properties: + type: + type: string + enum: + - approximate + city: + type: string + nullable: true + country: + type: string + nullable: true + region: + type: string + nullable: true + timezone: + type: string + nullable: true + required: + - type + cache_control: + type: object + properties: + type: + type: string + enum: + - ephemeral + ttl: + type: string + enum: + - 5m + - 1h + x-speakeasy-unknown-values: allow + required: + - type + required: + - type + - name + tool_choice: + oneOf: + - type: object + properties: + type: + type: string + enum: + - auto + disable_parallel_tool_use: + type: boolean + required: + - type + - type: object + properties: + type: + type: string + enum: + - any + disable_parallel_tool_use: + type: boolean + required: + - type + - type: object + properties: + type: + type: string + enum: + - none + required: + - type + - type: object + properties: + type: + type: string + enum: + - tool + name: + type: string + disable_parallel_tool_use: + type: boolean + required: + - type + - name + thinking: + oneOf: + - type: object + properties: + type: + type: string + enum: + - enabled + budget_tokens: + type: number + required: + - type + - budget_tokens + - type: object + properties: + type: + type: string + enum: + - disabled + required: + - type + service_tier: + type: string + enum: + - auto + - standard_only + x-speakeasy-unknown-values: allow + provider: + type: object + nullable: true + properties: + allow_fallbacks: + type: boolean + nullable: true + description: > + Whether to allow backup providers to serve requests + + - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. + + - false: use only the primary/custom provider, and return the upstream error if it's unavailable. + + require_parameters: + type: boolean + nullable: true + description: >- + Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. + data_collection: + $ref: '#/components/schemas/DataCollection' + zdr: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. + example: true + enforce_distillable_text: + type: boolean + nullable: true + description: >- + Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. + example: true + order: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. + only: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. + ignore: + type: array + nullable: true + items: + anyOf: + - $ref: '#/components/schemas/ProviderName' + - type: string + description: >- + List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. + quantizations: + type: array + nullable: true + items: + $ref: '#/components/schemas/Quantization' + description: A list of quantization levels to filter the provider by. + sort: + allOf: + - $ref: '#/components/schemas/ProviderSort' + - anyOf: + - $ref: '#/components/schemas/ProviderSort' + - $ref: '#/components/schemas/ProviderSortConfig' + - nullable: true + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. + max_price: + type: object + properties: + prompt: + $ref: '#/components/schemas/BigNumberUnion' + completion: + $ref: '#/components/schemas/BigNumberUnion' + image: + $ref: '#/components/schemas/BigNumberUnion' + audio: + $ref: '#/components/schemas/BigNumberUnion' + request: + $ref: '#/components/schemas/BigNumberUnion' + description: >- + The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + preferred_min_throughput: + $ref: '#/components/schemas/PreferredMinThroughput' + preferred_max_latency: + $ref: '#/components/schemas/PreferredMaxLatency' + additionalProperties: false + description: When multiple model providers are available, optionally indicate your routing preference. + plugins: + type: array + items: + oneOf: + - type: object + properties: + id: + type: string + enum: + - auto-router + enabled: + type: boolean + description: Set to false to disable the auto-router plugin for this request. Defaults to true. + allowed_models: + type: array + items: + type: string + description: >- + List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g., "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list. + example: + - anthropic/* + - openai/gpt-4o + - google/* + required: + - id + - type: object + properties: + id: + type: string + enum: + - moderation + required: + - id + - type: object + properties: + id: + type: string + enum: + - web + enabled: + type: boolean + description: Set to false to disable the web-search plugin for this request. Defaults to true. + max_results: + type: number + search_prompt: + type: string + engine: + $ref: '#/components/schemas/WebSearchEngine' + required: + - id + - type: object + properties: + id: + type: string + enum: + - file-parser + enabled: + type: boolean + description: Set to false to disable the file-parser plugin for this request. Defaults to true. + pdf: + $ref: '#/components/schemas/PDFParserOptions' + required: + - id + - type: object + properties: + id: + type: string + enum: + - response-healing + enabled: + type: boolean + description: Set to false to disable the response-healing plugin for this request. Defaults to true. + required: + - id + description: Plugins you want to enable for this request, including their settings. + route: + type: string + nullable: true + enum: + - fallback + - sort + deprecated: true + description: >- + **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition. Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none"). + x-speakeasy-deprecation-message: Use providers.sort.partition instead. + x-speakeasy-ignore: true + x-fern-ignore: true + x-speakeasy-unknown-values: allow + user: + type: string + maxLength: 128 + description: >- + A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. + session_id: + type: string + maxLength: 128 + description: >- + A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. + models: + type: array + items: + type: string + required: + - model + - max_tokens + - messages + description: Request schema for Anthropic Messages API endpoint + example: + model: anthropic/claude-4.5-sonnet-20250929 + max_tokens: 1024 + messages: + - role: user + content: Hello, how are you? + temperature: 0.7 ActivityItem: type: object properties: @@ -4344,6 +7415,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' audio: $ref: '#/components/schemas/BigNumberUnion' + audio_output: + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: $ref: '#/components/schemas/BigNumberUnion' web_search: @@ -4407,6 +7480,7 @@ components: - text - image - embeddings + - audio example: text x-speakeasy-unknown-values: allow ModelArchitecture: @@ -4616,6 +7690,11 @@ components: description: List of supported parameters for this model default_parameters: $ref: '#/components/schemas/DefaultParameters' + expiration_date: + type: string + nullable: true + description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. + example: '2025-06-01' required: - id - canonical_slug @@ -4659,6 +7738,7 @@ components: - top_p - max_tokens default_parameters: null + expiration_date: null ModelsListResponseData: type: array items: @@ -4705,6 +7785,7 @@ components: - frequency_penalty - presence_penalty default_parameters: null + expiration_date: null ModelsCountResponse: type: object properties: @@ -4797,6 +7878,10 @@ components: properties: name: type: string + model_id: + type: string + description: The unique identifier for the model (permaslug) + example: openai/gpt-4 model_name: type: string context_length: @@ -4818,6 +7903,8 @@ components: $ref: '#/components/schemas/BigNumberUnion' audio: $ref: '#/components/schemas/BigNumberUnion' + audio_output: + $ref: '#/components/schemas/BigNumberUnion' input_audio_cache: $ref: '#/components/schemas/BigNumberUnion' web_search: @@ -4868,6 +7955,7 @@ components: Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token generation speed. Only visible when authenticated with an API key or cookie; returns null for unauthenticated requests. required: - name + - model_id - model_name - context_length - pricing @@ -4884,6 +7972,7 @@ components: description: Information about a specific model endpoint example: name: 'OpenAI: GPT-4' + model_id: openai/gpt-4 model_name: GPT-4 context_length: 8192 pricing: @@ -5110,10 +8199,6 @@ components: - type: string - type: number __schema2: - anyOf: - - $ref: '#/components/schemas/ChatCompletionFinishReason' - - type: 'null' - __schema3: oneOf: - type: object properties: @@ -5123,11 +8208,11 @@ components: summary: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - summary @@ -5139,11 +8224,11 @@ components: data: type: string id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type - data @@ -5161,19 +8246,19 @@ components: - type: string - type: 'null' id: - $ref: '#/components/schemas/__schema4' + $ref: '#/components/schemas/__schema3' format: - $ref: '#/components/schemas/__schema5' + $ref: '#/components/schemas/__schema4' index: - $ref: '#/components/schemas/__schema6' + $ref: '#/components/schemas/__schema5' required: - type type: object - __schema4: + __schema3: anyOf: - type: string - type: 'null' - __schema5: + __schema4: anyOf: - type: string enum: @@ -5185,8 +8270,12 @@ components: - google-gemini-v1 x-speakeasy-unknown-values: allow - type: 'null' - __schema6: + __schema5: type: number + __schema6: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' ModelName: type: string ChatMessageContentItemText: @@ -5542,6 +8631,24 @@ components: anyOf: - type: string - type: 'null' + reasoning_details: + type: array + items: + $ref: '#/components/schemas/__schema2' + images: + type: array + items: + type: object + properties: + image_url: + type: object + properties: + url: + type: string + required: + - url + required: + - image_url required: - role ToolResponseMessage: @@ -6063,15 +9170,11 @@ components: type: object properties: finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number message: $ref: '#/components/schemas/AssistantMessage' - reasoning_details: - type: array - items: - $ref: '#/components/schemas/__schema3' logprobs: anyOf: - $ref: '#/components/schemas/ChatMessageTokenLogprobs' @@ -6125,14 +9228,14 @@ components: reasoning_details: type: array items: - $ref: '#/components/schemas/__schema3' + $ref: '#/components/schemas/__schema2' ChatStreamingChoice: type: object properties: delta: $ref: '#/components/schemas/ChatStreamingMessageChunk' finish_reason: - $ref: '#/components/schemas/__schema2' + $ref: '#/components/schemas/__schema6' index: type: number logprobs: @@ -6625,13 +9728,242 @@ paths: schema: $ref: '#/components/schemas/ProviderOverloadedResponse' operationId: createResponses + /messages: + post: + x-speakeasy-ignore: true + x-speakeasy-name-override: create + x-speakeasy-stream-request-field: stream + tags: + - anthropic.messages + summary: Create a message + description: >- + Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended thinking. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AnthropicMessagesRequest' + required: true + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/AnthropicMessagesResponse' + text/event-stream: + schema: + type: object + properties: + event: + type: string + data: + $ref: '#/components/schemas/AnthropicMessagesStreamEvent' + required: + - event + - data + x-speakeasy-sse-sentinel: '[DONE]' + '400': + description: Invalid request error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '401': + description: Authentication error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '403': + description: Permission denied error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '404': + description: Not found error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '429': + description: Rate limit error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '500': + description: API error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '503': + description: Overloaded error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + '529': + description: Overloaded error + content: + application/json: + schema: + type: object + properties: + type: + type: string + enum: + - error + error: + type: object + properties: + type: + type: string + message: + type: string + required: + - type + - message + required: + - type + - error + operationId: createMessages /activity: get: tags: - Analytics operationId: getUserActivity summary: Get user activity grouped by endpoint - description: Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + description: >- + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -6700,7 +10032,8 @@ paths: - Credits summary: Get remaining credits operationId: getCredits - description: Get total credits purchased and used for the authenticated user + description: >- + Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. responses: '200': description: Returns the total credits purchased and used @@ -7404,7 +10737,24 @@ paths: parameters: - schema: type: string + enum: + - programming + - roleplay + - marketing + - marketing/seo + - technology + - science + - translation + - legal + - finance + - health + - trivia + - academia + description: Filter models by use case category + example: programming + x-speakeasy-unknown-values: allow required: false + description: Filter models by use case category name: category in: query - schema: @@ -7529,117 +10879,6 @@ paths: schema: $ref: '#/components/schemas/InternalServerResponse' operationId: listEndpointsZdr - /parameters/{author}/{slug}: - get: - tags: - - Parameters - summary: Get a model's supported parameters and data about which are most popular - security: - - bearer: [] - parameters: - - schema: - type: string - required: true - name: author - in: path - - schema: - type: string - required: true - name: slug - in: path - - schema: - $ref: '#/components/schemas/ProviderName' - required: false - name: provider - in: query - responses: - '200': - description: Returns the parameters for the specified model - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - model: - type: string - description: Model identifier - example: openai/gpt-4 - supported_parameters: - type: array - items: - type: string - enum: - - temperature - - top_p - - top_k - - min_p - - top_a - - frequency_penalty - - presence_penalty - - repetition_penalty - - max_tokens - - logit_bias - - logprobs - - top_logprobs - - seed - - response_format - - structured_outputs - - stop - - tools - - tool_choice - - parallel_tool_calls - - include_reasoning - - reasoning - - reasoning_effort - - web_search_options - - verbosity - x-speakeasy-unknown-values: allow - description: List of parameters supported by this model - example: - - temperature - - top_p - - max_tokens - required: - - model - - supported_parameters - example: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - description: Parameter analytics data - required: - - data - example: - data: - model: openai/gpt-4 - supported_parameters: - - temperature - - top_p - - max_tokens - '401': - description: Unauthorized - Authentication required or invalid credentials - content: - application/json: - schema: - $ref: '#/components/schemas/UnauthorizedResponse' - '404': - description: Not Found - Model or provider does not exist - content: - application/json: - schema: - $ref: '#/components/schemas/NotFoundResponse' - '500': - description: Internal Server Error - Unexpected server error - content: - application/json: - schema: - $ref: '#/components/schemas/InternalServerResponse' - operationId: getParameters /providers: get: tags: @@ -7708,6 +10947,8 @@ paths: tags: - API Keys summary: List API keys + description: >- + List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string @@ -7741,7 +10982,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7749,7 +10990,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -7840,9 +11081,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -7864,7 +11105,7 @@ paths: - data example: data: - - hash: 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 + - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -7906,6 +11147,8 @@ paths: tags: - API Keys summary: Create a new API key + description: >- + Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. requestBody: content: application/json: @@ -7967,7 +11210,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -7975,7 +11218,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8066,9 +11309,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8095,7 +11338,7 @@ paths: - key example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My New API Key label: My New API Key disabled: false @@ -8146,11 +11389,12 @@ paths: tags: - API Keys summary: Update an API key + description: Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to update - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to update name: hash @@ -8210,7 +11454,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8218,7 +11462,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8309,9 +11553,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8333,7 +11577,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: Updated API Key Name label: Updated API Key Name disabled: false @@ -8388,11 +11632,12 @@ paths: tags: - API Keys summary: Delete an API key + description: Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to delete - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to delete name: hash @@ -8445,11 +11690,12 @@ paths: tags: - API Keys summary: Get a single API key + description: Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. parameters: - schema: type: string description: The hash identifier of the API key to retrieve - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 required: true description: The hash identifier of the API key to retrieve name: hash @@ -8468,7 +11714,7 @@ paths: hash: type: string description: Unique hash identifier for the API key - example: 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 + example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: type: string description: Name of the API key @@ -8476,7 +11722,7 @@ paths: label: type: string description: Human-readable label for the API key - example: Production API Key + example: sk-or-v1-0e6...1c96 disabled: type: boolean description: Whether the API key is disabled @@ -8567,9 +11813,9 @@ paths: - created_at - updated_at example: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key - label: Production API Key + label: sk-or-v1-0e6...1c96 disabled: false limit: 100 limit_remaining: 74.5 @@ -8591,7 +11837,7 @@ paths: - data example: data: - hash: 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 + hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 name: My Production Key label: Production API Key disabled: false @@ -8634,6 +11880,1507 @@ paths: application/json: schema: $ref: '#/components/schemas/InternalServerResponse' + /guardrails: + get: + operationId: listGuardrails + x-speakeasy-name-override: list + tags: + - Guardrails + summary: List guardrails + description: >- + List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of guardrails + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: List of guardrails + total_count: + type: number + description: Total number of guardrails + example: 25 + required: + - data + - total_count + example: + data: + - id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + total_count: 1 + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: createGuardrail + x-speakeasy-name-override: create + tags: + - Guardrails + summary: Create a guardrail + description: >- + Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: Name for the new guardrail + example: My New Guardrail + description: + type: string + nullable: true + maxLength: 1000 + description: Description of the guardrail + example: A guardrail for limiting API usage + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 50 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: List of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + required: + - name + example: + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - deepseek + allowed_models: null + enforce_zdr: false + required: true + responses: + '201': + description: Guardrail created successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The created guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: My New Guardrail + description: A guardrail for limiting API usage + limit_usd: 50 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: null + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}: + get: + operationId: getGuardrail + x-speakeasy-name-override: get + tags: + - Guardrails + summary: Get a guardrail + description: Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to retrieve + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to retrieve + name: id + in: path + responses: + '200': + description: Guardrail details + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + patch: + operationId: updateGuardrail + x-speakeasy-name-override: update + tags: + - Guardrails + summary: Update a guardrail + description: Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to update + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to update + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + minLength: 1 + maxLength: 200 + description: New name for the guardrail + example: Updated Guardrail Name + description: + type: string + nullable: true + maxLength: 1000 + description: New description for the guardrail + example: Updated description + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: New spending limit in USD + example: 75 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + minItems: 1 + description: New list of allowed provider IDs + example: + - openai + - anthropic + - deepseek + allowed_models: + type: array + nullable: true + items: + type: string + minItems: 1 + description: Array of model identifiers (slug or canonical_slug accepted) + example: + - openai/gpt-5.2 + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: true + example: + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + required: true + responses: + '200': + description: Guardrail updated successfully + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + name: + type: string + description: Name of the guardrail + example: Production Guardrail + description: + type: string + nullable: true + description: Description of the guardrail + example: Guardrail for production environment + limit_usd: + type: number + nullable: true + minimum: 0 + exclusiveMinimum: true + description: Spending limit in USD + example: 100 + reset_interval: + type: string + nullable: true + enum: + - daily + - weekly + - monthly + description: Interval at which the limit resets (daily, weekly, monthly) + example: monthly + x-speakeasy-unknown-values: allow + allowed_providers: + type: array + nullable: true + items: + type: string + description: List of allowed provider IDs + example: + - openai + - anthropic + - google + allowed_models: + type: array + nullable: true + items: + type: string + description: Array of model canonical_slugs (immutable identifiers) + example: + - openai/gpt-5.2-20251211 + - anthropic/claude-4.5-opus-20251124 + - deepseek/deepseek-r1-0528:free + enforce_zdr: + type: boolean + nullable: true + description: Whether to enforce zero data retention + example: false + created_at: + type: string + description: ISO 8601 timestamp of when the guardrail was created + example: '2025-08-24T10:30:00Z' + updated_at: + type: string + nullable: true + description: ISO 8601 timestamp of when the guardrail was last updated + example: '2025-08-24T15:45:00Z' + required: + - id + - name + - created_at + example: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Production Guardrail + description: Guardrail for production environment + limit_usd: 100 + reset_interval: monthly + allowed_providers: + - openai + - anthropic + - google + allowed_models: null + enforce_zdr: false + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T15:45:00Z' + description: The updated guardrail + required: + - data + example: + data: + id: 550e8400-e29b-41d4-a716-446655440000 + name: Updated Guardrail Name + description: Updated description + limit_usd: 75 + reset_interval: weekly + allowed_providers: + - openai + allowed_models: null + enforce_zdr: true + created_at: '2025-08-24T10:30:00Z' + updated_at: '2025-08-24T16:00:00Z' + '400': + description: Bad Request - Invalid request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + delete: + operationId: deleteGuardrail + x-speakeasy-name-override: delete + tags: + - Guardrails + summary: Delete a guardrail + description: Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail to delete + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail to delete + name: id + in: path + responses: + '200': + description: Guardrail deleted successfully + content: + application/json: + schema: + type: object + properties: + deleted: + type: boolean + const: true + description: Confirmation that the guardrail was deleted + example: true + required: + - deleted + example: + deleted: true + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Not Found - Guardrail does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/keys: + get: + operationId: listKeyAssignments + x-speakeasy-name-override: listKeyAssignments + tags: + - Guardrails + summary: List all key assignments + description: >- + List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/assignments/members: + get: + operationId: listMemberAssignments + x-speakeasy-name-override: listMemberAssignments + tags: + - Guardrails + summary: List all member assignments + description: >- + List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys: + get: + operationId: listGuardrailKeyAssignments + x-speakeasy-name-override: listGuardrailKeyAssignments + tags: + - Guardrails + summary: List key assignments for a guardrail + description: >- + List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of key assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + key_hash: + type: string + description: Hash of the assigned API key + example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + key_name: + type: string + description: Name of the API key + example: Production Key + key_label: + type: string + description: Label of the API key + example: prod-key + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - key_hash + - guardrail_id + - key_name + - key_label + - assigned_by + - created_at + description: List of key assignments + total_count: + type: number + description: Total number of key assignments for this guardrail + example: 25 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignKeysToGuardrail + x-speakeasy-name-override: bulkAssignKeys + tags: + - Guardrails + summary: Bulk assign keys to a guardrail + description: >- + Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to assign to the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of keys successfully assigned + example: 3 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members: + get: + operationId: listGuardrailMemberAssignments + x-speakeasy-name-override: listGuardrailMemberAssignments + tags: + - Guardrails + summary: List member assignments for a guardrail + description: >- + List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + - schema: + type: string + description: Number of records to skip for pagination + example: '0' + required: false + description: Number of records to skip for pagination + name: offset + in: query + - schema: + type: string + description: Maximum number of records to return (max 100) + example: '50' + required: false + description: Maximum number of records to return (max 100) + name: limit + in: query + responses: + '200': + description: List of member assignments + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier for the assignment + example: 550e8400-e29b-41d4-a716-446655440000 + user_id: + type: string + description: Clerk user ID of the assigned member + example: user_abc123 + organization_id: + type: string + description: Organization ID + example: org_xyz789 + guardrail_id: + type: string + format: uuid + description: ID of the guardrail + example: 550e8400-e29b-41d4-a716-446655440001 + assigned_by: + type: string + nullable: true + description: User ID of who made the assignment + example: user_abc123 + created_at: + type: string + description: ISO 8601 timestamp of when the assignment was created + example: '2025-08-24T10:30:00Z' + required: + - id + - user_id + - organization_id + - guardrail_id + - assigned_by + - created_at + description: List of member assignments + total_count: + type: number + description: Total number of member assignments + example: 10 + required: + - data + - total_count + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + post: + operationId: bulkAssignMembersToGuardrail + x-speakeasy-name-override: bulkAssignMembers + tags: + - Guardrails + summary: Bulk assign members to a guardrail + description: >- + Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to assign to the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Assignment result + content: + application/json: + schema: + type: object + properties: + assigned_count: + type: number + description: Number of members successfully assigned + example: 2 + required: + - assigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/keys/remove: + post: + operationId: bulkUnassignKeysFromGuardrail + x-speakeasy-name-override: bulkUnassignKeys + tags: + - Guardrails + summary: Bulk unassign keys from a guardrail + description: >- + Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + key_hashes: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of API key hashes to unassign from the guardrail + example: + - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 + required: + - key_hashes + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of keys successfully unassigned + example: 3 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' + /guardrails/{id}/assignments/members/remove: + post: + operationId: bulkUnassignMembersFromGuardrail + x-speakeasy-name-override: bulkUnassignMembers + tags: + - Guardrails + summary: Bulk unassign members from a guardrail + description: >- + Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + parameters: + - schema: + type: string + format: uuid + description: The unique identifier of the guardrail + example: 550e8400-e29b-41d4-a716-446655440000 + required: true + description: The unique identifier of the guardrail + name: id + in: path + requestBody: + content: + application/json: + schema: + type: object + properties: + member_user_ids: + type: array + items: + type: string + minLength: 1 + minItems: 1 + description: Array of member user IDs to unassign from the guardrail + example: + - user_abc123 + - user_def456 + required: + - member_user_ids + required: true + responses: + '200': + description: Unassignment result + content: + application/json: + schema: + type: object + properties: + unassigned_count: + type: number + description: Number of members successfully unassigned + example: 2 + required: + - unassigned_count + '400': + description: Bad Request - Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequestResponse' + '401': + description: Unauthorized - Missing or invalid authentication + content: + application/json: + schema: + $ref: '#/components/schemas/UnauthorizedResponse' + '404': + description: Guardrail not found + content: + application/json: + schema: + $ref: '#/components/schemas/NotFoundResponse' + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/InternalServerResponse' /key: get: operationId: getCurrentKey @@ -8656,7 +13403,7 @@ paths: label: type: string description: Human-readable label for the API key - example: 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 + example: sk-or-v1-0e6...1c96 limit: type: number nullable: true @@ -8766,7 +13513,7 @@ paths: - rate_limit description: Current API key information example: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -8790,7 +13537,7 @@ paths: - data example: data: - label: sk-or-v1-au78b3456789012345678901234567890 + label: sk-or-v1-au7...890 limit: 100 usage: 25.5 usage_daily: 25.5 @@ -9130,14 +13877,16 @@ tags: description: Endpoint information - name: Generations description: Generation history endpoints + - name: Guardrails + description: Guardrails endpoints - name: Models description: Model information endpoints - name: OAuth description: OAuth authentication endpoints - - name: Parameters - description: Parameters endpoints - name: Providers description: Provider information endpoints + - name: anthropic.messages + description: anthropic.messages endpoints - name: beta.responses description: beta.responses endpoints x-fern-base-path: / diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f55dd7d..ff94a13 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -8,8 +8,8 @@ sources: - latest OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7 - sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925 + sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76 + sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2 tags: - latest - 1.0.0 @@ -17,10 +17,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:74aa60ddccc9442b797432138c9ea1577f922ae537a659f129b4102d3a8124d7 - sourceBlobDigest: sha256:c9ae686141914431fb09ce7f0ff685c5b20c19006a92ade6d8686358616f6925 + sourceRevisionDigest: sha256:291e215687f85db05005d79dd87602a75b8086f39a841700fdbaaff7690b4f76 + sourceBlobDigest: sha256:166639d08f0ae9687cea532ed8a93db59e63293c6a6f4d17d63f015b60d643d2 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:b856f0612e3d962a895275c9aac8054f5747fd0ece05073fb005688659d286fe + codeSamplesRevisionDigest: sha256:f19eae09ec90a23147935f07a86f75dbbc998e6bac3b820351a1e5f147fec590 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.666.0 diff --git a/docs/components/assistantmessage.md b/docs/components/assistantmessage.md index 072fe37..532cbb2 100644 --- a/docs/components/assistantmessage.md +++ b/docs/components/assistantmessage.md @@ -10,4 +10,6 @@ | `name` | *Optional[str]* | :heavy_minus_sign: | N/A | | `tool_calls` | List[[components.ChatMessageToolCall](../components/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A | | `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A | +| `images` | List[[components.Image](../components/image.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/operations/getparameterssecurity.md b/docs/components/assistantmessageimageurl.md similarity index 69% rename from docs/operations/getparameterssecurity.md rename to docs/components/assistantmessageimageurl.md index 7f8062f..1067d52 100644 --- a/docs/operations/getparameterssecurity.md +++ b/docs/components/assistantmessageimageurl.md @@ -1,8 +1,8 @@ -# GetParametersSecurity +# AssistantMessageImageURL ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `bearer` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/chatmessagecontentitemimage.md b/docs/components/chatmessagecontentitemimage.md index f177bf7..bab58c2 100644 --- a/docs/components/chatmessagecontentitemimage.md +++ b/docs/components/chatmessagecontentitemimage.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A | -| `image_url` | [components.ImageURL](../components/imageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A | +| `image_url` | [components.ChatMessageContentItemImageImageURL](../components/chatmessagecontentitemimageimageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/imageurl.md b/docs/components/chatmessagecontentitemimageimageurl.md similarity index 97% rename from docs/components/imageurl.md rename to docs/components/chatmessagecontentitemimageimageurl.md index 740bdcd..7aa3e7f 100644 --- a/docs/components/imageurl.md +++ b/docs/components/chatmessagecontentitemimageimageurl.md @@ -1,4 +1,4 @@ -# ImageURL +# ChatMessageContentItemImageImageURL ## Fields diff --git a/docs/components/chatresponsechoice.md b/docs/components/chatresponsechoice.md index 82a46e5..54b4a32 100644 --- a/docs/components/chatresponsechoice.md +++ b/docs/components/chatresponsechoice.md @@ -8,5 +8,4 @@ | `finish_reason` | [Nullable[components.ChatCompletionFinishReason]](../components/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A | | `index` | *float* | :heavy_check_mark: | N/A | | `message` | [components.AssistantMessage](../components/assistantmessage.md) | :heavy_check_mark: | N/A | -| `reasoning_details` | List[[components.Schema3](../components/schema3.md)] | :heavy_minus_sign: | N/A | | `logprobs` | [OptionalNullable[components.ChatMessageTokenLogprobs]](../components/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/chatstreamingmessagechunk.md b/docs/components/chatstreamingmessagechunk.md index 9d622a2..eb70467 100644 --- a/docs/components/chatstreamingmessagechunk.md +++ b/docs/components/chatstreamingmessagechunk.md @@ -10,4 +10,4 @@ | `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `tool_calls` | List[[components.ChatStreamingMessageToolCall](../components/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A | -| `reasoning_details` | List[[components.Schema3](../components/schema3.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `reasoning_details` | List[[components.Schema2](../components/schema2.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/image.md b/docs/components/image.md new file mode 100644 index 0000000..1c8c8f5 --- /dev/null +++ b/docs/components/image.md @@ -0,0 +1,8 @@ +# Image + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `image_url` | [components.AssistantMessageImageURL](../components/assistantmessageimageurl.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/model.md b/docs/components/model.md index b48d9a6..86c7cd6 100644 --- a/docs/components/model.md +++ b/docs/components/model.md @@ -19,4 +19,5 @@ Information about an AI model available on OpenRouter | `top_provider` | [components.TopProviderInfo](../components/topproviderinfo.md) | :heavy_check_mark: | Information about the top provider for this model | {
"context_length": 8192,
"max_completion_tokens": 4096,
"is_moderated": true
} | | `per_request_limits` | [Nullable[components.PerRequestLimits]](../components/perrequestlimits.md) | :heavy_check_mark: | Per-request token limits | {
"prompt_tokens": 1000,
"completion_tokens": 1000
} | | `supported_parameters` | List[[components.Parameter](../components/parameter.md)] | :heavy_check_mark: | List of supported parameters for this model | | -| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0
} | \ No newline at end of file +| `default_parameters` | [Nullable[components.DefaultParameters]](../components/defaultparameters.md) | :heavy_check_mark: | Default parameters for this model | {
"temperature": 0.7,
"top_p": 0.9,
"frequency_penalty": 0
} | +| `expiration_date` | *OptionalNullable[str]* | :heavy_minus_sign: | The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration. | 2025-06-01 | \ No newline at end of file diff --git a/docs/components/outputmodality.md b/docs/components/outputmodality.md index 97c0497..1601276 100644 --- a/docs/components/outputmodality.md +++ b/docs/components/outputmodality.md @@ -7,4 +7,5 @@ | ------------ | ------------ | | `TEXT` | text | | `IMAGE` | image | -| `EMBEDDINGS` | embeddings | \ No newline at end of file +| `EMBEDDINGS` | embeddings | +| `AUDIO` | audio | \ No newline at end of file diff --git a/docs/components/pricing.md b/docs/components/pricing.md index cb8a03a..1c4d87a 100644 --- a/docs/components/pricing.md +++ b/docs/components/pricing.md @@ -12,6 +12,7 @@ | `image_token` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `image_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `web_search` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | diff --git a/docs/components/publicendpoint.md b/docs/components/publicendpoint.md index dac1698..147ff51 100644 --- a/docs/components/publicendpoint.md +++ b/docs/components/publicendpoint.md @@ -8,6 +8,7 @@ Information about a specific model endpoint | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | N/A | | +| `model_id` | *str* | :heavy_check_mark: | The unique identifier for the model (permaslug) | openai/gpt-4 | | `model_name` | *str* | :heavy_check_mark: | N/A | | | `context_length` | *float* | :heavy_check_mark: | N/A | | | `pricing` | [components.Pricing](../components/pricing.md) | :heavy_check_mark: | N/A | | diff --git a/docs/components/publicpricing.md b/docs/components/publicpricing.md index 0c330ad..7a4eba7 100644 --- a/docs/components/publicpricing.md +++ b/docs/components/publicpricing.md @@ -14,6 +14,7 @@ Pricing information for the model | `image_token` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `image_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `audio` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | +| `audio_output` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `input_audio_cache` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `web_search` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | | `internal_reasoning` | *Optional[str]* | :heavy_minus_sign: | A value in string format that is a large number | 1000 | diff --git a/docs/components/schema2.md b/docs/components/schema2.md new file mode 100644 index 0000000..42b74cf --- /dev/null +++ b/docs/components/schema2.md @@ -0,0 +1,23 @@ +# Schema2 + + +## Supported Types + +### `components.Schema2ReasoningSummary` + +```python +value: components.Schema2ReasoningSummary = /* values here */ +``` + +### `components.Schema2ReasoningEncrypted` + +```python +value: components.Schema2ReasoningEncrypted = /* values here */ +``` + +### `components.Schema2ReasoningText` + +```python +value: components.Schema2ReasoningText = /* values here */ +``` + diff --git a/docs/components/schema3reasoningencrypted.md b/docs/components/schema2reasoningencrypted.md similarity index 91% rename from docs/components/schema3reasoningencrypted.md rename to docs/components/schema2reasoningencrypted.md index 1441d0d..0cc8c33 100644 --- a/docs/components/schema3reasoningencrypted.md +++ b/docs/components/schema2reasoningencrypted.md @@ -1,4 +1,4 @@ -# Schema3ReasoningEncrypted +# Schema2ReasoningEncrypted ## Fields @@ -8,5 +8,5 @@ | `type` | *Literal["reasoning.encrypted"]* | :heavy_check_mark: | N/A | | `data` | *str* | :heavy_check_mark: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema3reasoningsummary.md b/docs/components/schema2reasoningsummary.md similarity index 92% rename from docs/components/schema3reasoningsummary.md rename to docs/components/schema2reasoningsummary.md index d5e348d..82ec98d 100644 --- a/docs/components/schema3reasoningsummary.md +++ b/docs/components/schema2reasoningsummary.md @@ -1,4 +1,4 @@ -# Schema3ReasoningSummary +# Schema2ReasoningSummary ## Fields @@ -8,5 +8,5 @@ | `type` | *Literal["reasoning.summary"]* | :heavy_check_mark: | N/A | | `summary` | *str* | :heavy_check_mark: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema3reasoningtext.md b/docs/components/schema2reasoningtext.md similarity index 93% rename from docs/components/schema3reasoningtext.md rename to docs/components/schema2reasoningtext.md index d64ae86..3d1ff9a 100644 --- a/docs/components/schema3reasoningtext.md +++ b/docs/components/schema2reasoningtext.md @@ -1,4 +1,4 @@ -# Schema3ReasoningText +# Schema2ReasoningText ## Fields @@ -9,5 +9,5 @@ | `text` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `signature` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `format_` | [OptionalNullable[components.Schema5]](../components/schema5.md) | :heavy_minus_sign: | N/A | +| `format_` | [OptionalNullable[components.Schema4]](../components/schema4.md) | :heavy_minus_sign: | N/A | | `index` | *Optional[float]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/schema3.md b/docs/components/schema3.md deleted file mode 100644 index afe2a72..0000000 --- a/docs/components/schema3.md +++ /dev/null @@ -1,23 +0,0 @@ -# Schema3 - - -## Supported Types - -### `components.Schema3ReasoningSummary` - -```python -value: components.Schema3ReasoningSummary = /* values here */ -``` - -### `components.Schema3ReasoningEncrypted` - -```python -value: components.Schema3ReasoningEncrypted = /* values here */ -``` - -### `components.Schema3ReasoningText` - -```python -value: components.Schema3ReasoningText = /* values here */ -``` - diff --git a/docs/components/schema5.md b/docs/components/schema4.md similarity index 98% rename from docs/components/schema5.md rename to docs/components/schema4.md index 64eb2b3..9e927db 100644 --- a/docs/components/schema5.md +++ b/docs/components/schema4.md @@ -1,4 +1,4 @@ -# Schema5 +# Schema4 ## Values diff --git a/docs/operations/bulkassignkeystoguardrailrequest.md b/docs/operations/bulkassignkeystoguardrailrequest.md new file mode 100644 index 0000000..f639a33 --- /dev/null +++ b/docs/operations/bulkassignkeystoguardrailrequest.md @@ -0,0 +1,9 @@ +# BulkAssignKeysToGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `request_body` | [operations.BulkAssignKeysToGuardrailRequestBody](../operations/bulkassignkeystoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkassignkeystoguardrailrequestbody.md b/docs/operations/bulkassignkeystoguardrailrequestbody.md new file mode 100644 index 0000000..38b45b3 --- /dev/null +++ b/docs/operations/bulkassignkeystoguardrailrequestbody.md @@ -0,0 +1,8 @@ +# BulkAssignKeysToGuardrailRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to assign to the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | \ No newline at end of file diff --git a/docs/operations/bulkassignkeystoguardrailresponse.md b/docs/operations/bulkassignkeystoguardrailresponse.md new file mode 100644 index 0000000..11f3e69 --- /dev/null +++ b/docs/operations/bulkassignkeystoguardrailresponse.md @@ -0,0 +1,10 @@ +# BulkAssignKeysToGuardrailResponse + +Assignment result + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `assigned_count` | *float* | :heavy_check_mark: | Number of keys successfully assigned | 3 | \ No newline at end of file diff --git a/docs/operations/bulkassignmemberstoguardrailrequest.md b/docs/operations/bulkassignmemberstoguardrailrequest.md new file mode 100644 index 0000000..6ef2ba2 --- /dev/null +++ b/docs/operations/bulkassignmemberstoguardrailrequest.md @@ -0,0 +1,9 @@ +# BulkAssignMembersToGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `request_body` | [operations.BulkAssignMembersToGuardrailRequestBody](../operations/bulkassignmemberstoguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkassignmemberstoguardrailrequestbody.md b/docs/operations/bulkassignmemberstoguardrailrequestbody.md new file mode 100644 index 0000000..505532f --- /dev/null +++ b/docs/operations/bulkassignmemberstoguardrailrequestbody.md @@ -0,0 +1,8 @@ +# BulkAssignMembersToGuardrailRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to assign to the guardrail | [
"user_abc123",
"user_def456"
] | \ No newline at end of file diff --git a/docs/operations/bulkassignmemberstoguardrailresponse.md b/docs/operations/bulkassignmemberstoguardrailresponse.md new file mode 100644 index 0000000..402d357 --- /dev/null +++ b/docs/operations/bulkassignmemberstoguardrailresponse.md @@ -0,0 +1,10 @@ +# BulkAssignMembersToGuardrailResponse + +Assignment result + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `assigned_count` | *float* | :heavy_check_mark: | Number of members successfully assigned | 2 | \ No newline at end of file diff --git a/docs/operations/bulkunassignkeysfromguardrailrequest.md b/docs/operations/bulkunassignkeysfromguardrailrequest.md new file mode 100644 index 0000000..10c7c12 --- /dev/null +++ b/docs/operations/bulkunassignkeysfromguardrailrequest.md @@ -0,0 +1,9 @@ +# BulkUnassignKeysFromGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `request_body` | [operations.BulkUnassignKeysFromGuardrailRequestBody](../operations/bulkunassignkeysfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkunassignkeysfromguardrailrequestbody.md b/docs/operations/bulkunassignkeysfromguardrailrequestbody.md new file mode 100644 index 0000000..5f4b2bd --- /dev/null +++ b/docs/operations/bulkunassignkeysfromguardrailrequestbody.md @@ -0,0 +1,8 @@ +# BulkUnassignKeysFromGuardrailRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to unassign from the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | \ No newline at end of file diff --git a/docs/operations/bulkunassignkeysfromguardrailresponse.md b/docs/operations/bulkunassignkeysfromguardrailresponse.md new file mode 100644 index 0000000..f789d2a --- /dev/null +++ b/docs/operations/bulkunassignkeysfromguardrailresponse.md @@ -0,0 +1,10 @@ +# BulkUnassignKeysFromGuardrailResponse + +Unassignment result + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `unassigned_count` | *float* | :heavy_check_mark: | Number of keys successfully unassigned | 3 | \ No newline at end of file diff --git a/docs/operations/bulkunassignmembersfromguardrailrequest.md b/docs/operations/bulkunassignmembersfromguardrailrequest.md new file mode 100644 index 0000000..4283486 --- /dev/null +++ b/docs/operations/bulkunassignmembersfromguardrailrequest.md @@ -0,0 +1,9 @@ +# BulkUnassignMembersFromGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `request_body` | [operations.BulkUnassignMembersFromGuardrailRequestBody](../operations/bulkunassignmembersfromguardrailrequestbody.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/operations/bulkunassignmembersfromguardrailrequestbody.md b/docs/operations/bulkunassignmembersfromguardrailrequestbody.md new file mode 100644 index 0000000..76855da --- /dev/null +++ b/docs/operations/bulkunassignmembersfromguardrailrequestbody.md @@ -0,0 +1,8 @@ +# BulkUnassignMembersFromGuardrailRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to unassign from the guardrail | [
"user_abc123",
"user_def456"
] | \ No newline at end of file diff --git a/docs/operations/bulkunassignmembersfromguardrailresponse.md b/docs/operations/bulkunassignmembersfromguardrailresponse.md new file mode 100644 index 0000000..76e85b2 --- /dev/null +++ b/docs/operations/bulkunassignmembersfromguardrailresponse.md @@ -0,0 +1,10 @@ +# BulkUnassignMembersFromGuardrailResponse + +Unassignment result + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `unassigned_count` | *float* | :heavy_check_mark: | Number of members successfully unassigned | 2 | \ No newline at end of file diff --git a/docs/operations/category.md b/docs/operations/category.md new file mode 100644 index 0000000..f0fa9d7 --- /dev/null +++ b/docs/operations/category.md @@ -0,0 +1,21 @@ +# Category + +Filter models by use case category + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `PROGRAMMING` | programming | +| `ROLEPLAY` | roleplay | +| `MARKETING` | marketing | +| `MARKETING_SEO` | marketing/seo | +| `TECHNOLOGY` | technology | +| `SCIENCE` | science | +| `TRANSLATION` | translation | +| `LEGAL` | legal | +| `FINANCE` | finance | +| `HEALTH` | health | +| `TRIVIA` | trivia | +| `ACADEMIA` | academia | \ No newline at end of file diff --git a/docs/operations/createguardraildata.md b/docs/operations/createguardraildata.md new file mode 100644 index 0000000..f98ee89 --- /dev/null +++ b/docs/operations/createguardraildata.md @@ -0,0 +1,19 @@ +# CreateGuardrailData + +The created guardrail + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalResponse]](../operations/createguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/operations/createguardrailrequest.md b/docs/operations/createguardrailrequest.md new file mode 100644 index 0000000..507257d --- /dev/null +++ b/docs/operations/createguardrailrequest.md @@ -0,0 +1,14 @@ +# CreateGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | +| `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalRequest]](../operations/createguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | \ No newline at end of file diff --git a/docs/operations/createguardrailresetintervalrequest.md b/docs/operations/createguardrailresetintervalrequest.md new file mode 100644 index 0000000..4d591a7 --- /dev/null +++ b/docs/operations/createguardrailresetintervalrequest.md @@ -0,0 +1,12 @@ +# CreateGuardrailResetIntervalRequest + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/createguardrailresetintervalresponse.md b/docs/operations/createguardrailresetintervalresponse.md new file mode 100644 index 0000000..b49fa04 --- /dev/null +++ b/docs/operations/createguardrailresetintervalresponse.md @@ -0,0 +1,12 @@ +# CreateGuardrailResetIntervalResponse + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/createguardrailresponse.md b/docs/operations/createguardrailresponse.md new file mode 100644 index 0000000..0afc006 --- /dev/null +++ b/docs/operations/createguardrailresponse.md @@ -0,0 +1,10 @@ +# CreateGuardrailResponse + +Guardrail created successfully + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateGuardrailData](../operations/createguardraildata.md) | :heavy_check_mark: | The created guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/createkeysdata.md b/docs/operations/createkeysdata.md index 33e9681..cd28aac 100644 --- a/docs/operations/createkeysdata.md +++ b/docs/operations/createkeysdata.md @@ -7,9 +7,9 @@ The created API key information | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *bool* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/operations/createkeysresponse.md b/docs/operations/createkeysresponse.md index 92fa4a0..cf2b1cf 100644 --- a/docs/operations/createkeysresponse.md +++ b/docs/operations/createkeysresponse.md @@ -5,7 +5,7 @@ API key created successfully ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.CreateKeysData](../operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"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"
} | -| `key` | *str* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.CreateKeysData](../operations/createkeysdata.md) | :heavy_check_mark: | The created API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"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"
} | +| `key` | *str* | :heavy_check_mark: | The actual API key string (only shown once) | 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 | \ No newline at end of file diff --git a/docs/operations/deleteguardrailrequest.md b/docs/operations/deleteguardrailrequest.md new file mode 100644 index 0000000..4e2181a --- /dev/null +++ b/docs/operations/deleteguardrailrequest.md @@ -0,0 +1,8 @@ +# DeleteGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/operations/deleteguardrailresponse.md b/docs/operations/deleteguardrailresponse.md new file mode 100644 index 0000000..b548b9f --- /dev/null +++ b/docs/operations/deleteguardrailresponse.md @@ -0,0 +1,10 @@ +# DeleteGuardrailResponse + +Guardrail deleted successfully + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `deleted` | *Literal[True]* | :heavy_check_mark: | Confirmation that the guardrail was deleted | true | \ No newline at end of file diff --git a/docs/operations/deletekeysrequest.md b/docs/operations/deletekeysrequest.md index b3fc3f3..988c8da 100644 --- a/docs/operations/deletekeysrequest.md +++ b/docs/operations/deletekeysrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/operations/getcurrentkeydata.md b/docs/operations/getcurrentkeydata.md index f5b6b9e..2269a19 100644 --- a/docs/operations/getcurrentkeydata.md +++ b/docs/operations/getcurrentkeydata.md @@ -7,7 +7,7 @@ Current API key information | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | 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 | +| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `usage` | *float* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 | | `usage_daily` | *float* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 | diff --git a/docs/operations/getcurrentkeyresponse.md b/docs/operations/getcurrentkeyresponse.md index 3711810..f84ddb9 100644 --- a/docs/operations/getcurrentkeyresponse.md +++ b/docs/operations/getcurrentkeyresponse.md @@ -5,6 +5,6 @@ API key details ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetCurrentKeyData](../operations/getcurrentkeydata.md) | :heavy_check_mark: | Current API key information | {
"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."
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetCurrentKeyData](../operations/getcurrentkeydata.md) | :heavy_check_mark: | Current API key information | {
"label": "sk-or-v1-au7...890",
"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."
}
} | \ No newline at end of file diff --git a/docs/operations/getguardraildata.md b/docs/operations/getguardraildata.md new file mode 100644 index 0000000..5a31535 --- /dev/null +++ b/docs/operations/getguardraildata.md @@ -0,0 +1,19 @@ +# GetGuardrailData + +The guardrail + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `reset_interval` | [OptionalNullable[operations.GetGuardrailResetInterval]](../operations/getguardrailresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/operations/getguardrailrequest.md b/docs/operations/getguardrailrequest.md new file mode 100644 index 0000000..5e11a52 --- /dev/null +++ b/docs/operations/getguardrailrequest.md @@ -0,0 +1,8 @@ +# GetGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 | \ No newline at end of file diff --git a/docs/operations/getguardrailresetinterval.md b/docs/operations/getguardrailresetinterval.md new file mode 100644 index 0000000..48f4f0e --- /dev/null +++ b/docs/operations/getguardrailresetinterval.md @@ -0,0 +1,12 @@ +# GetGuardrailResetInterval + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/getguardrailresponse.md b/docs/operations/getguardrailresponse.md new file mode 100644 index 0000000..ee53506 --- /dev/null +++ b/docs/operations/getguardrailresponse.md @@ -0,0 +1,10 @@ +# GetGuardrailResponse + +Guardrail details + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetGuardrailData](../operations/getguardraildata.md) | :heavy_check_mark: | The guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/getkeydata.md b/docs/operations/getkeydata.md index dd61419..3ada9d0 100644 --- a/docs/operations/getkeydata.md +++ b/docs/operations/getkeydata.md @@ -7,9 +7,9 @@ The API key information | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *bool* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/operations/getkeyrequest.md b/docs/operations/getkeyrequest.md index 0f125f6..7e5d949 100644 --- a/docs/operations/getkeyrequest.md +++ b/docs/operations/getkeyrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | 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 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | \ No newline at end of file diff --git a/docs/operations/getkeyresponse.md b/docs/operations/getkeyresponse.md index 7fad4c3..c25cba3 100644 --- a/docs/operations/getkeyresponse.md +++ b/docs/operations/getkeyresponse.md @@ -5,6 +5,6 @@ API key details ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.GetKeyData](../operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"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"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.GetKeyData](../operations/getkeydata.md) | :heavy_check_mark: | The API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"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"
} | \ No newline at end of file diff --git a/docs/operations/getmodelsrequest.md b/docs/operations/getmodelsrequest.md index b08feb5..b30704f 100644 --- a/docs/operations/getmodelsrequest.md +++ b/docs/operations/getmodelsrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `category` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `category` | [Optional[operations.Category]](../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/operations/getparametersrequest.md b/docs/operations/getparametersrequest.md deleted file mode 100644 index 6c24661..0000000 --- a/docs/operations/getparametersrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetParametersRequest - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `author` | *str* | :heavy_check_mark: | N/A | | -| `slug` | *str* | :heavy_check_mark: | N/A | | -| `provider` | [Optional[components.ProviderName]](../components/providername.md) | :heavy_minus_sign: | N/A | OpenAI | \ No newline at end of file diff --git a/docs/operations/getparametersresponse.md b/docs/operations/getparametersresponse.md deleted file mode 100644 index e1faca1..0000000 --- a/docs/operations/getparametersresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetParametersResponse - -Returns the parameters for the specified model - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `data` | [operations.GetParametersData](../operations/getparametersdata.md) | :heavy_check_mark: | Parameter analytics data | {
"model": "openai/gpt-4",
"supported_parameters": [
"temperature",
"top_p",
"max_tokens"
]
} | \ No newline at end of file diff --git a/docs/operations/listdata.md b/docs/operations/listdata.md index edebb91..b43de29 100644 --- a/docs/operations/listdata.md +++ b/docs/operations/listdata.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *bool* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/operations/listguardrailkeyassignmentsdata.md b/docs/operations/listguardrailkeyassignmentsdata.md new file mode 100644 index 0000000..285bd05 --- /dev/null +++ b/docs/operations/listguardrailkeyassignmentsdata.md @@ -0,0 +1,14 @@ +# ListGuardrailKeyAssignmentsData + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `key_hash` | *str* | :heavy_check_mark: | Hash of the assigned API key | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `guardrail_id` | *str* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `key_name` | *str* | :heavy_check_mark: | Name of the API key | Production Key | +| `key_label` | *str* | :heavy_check_mark: | Label of the API key | prod-key | +| `assigned_by` | *Nullable[str]* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/operations/listguardrailkeyassignmentsrequest.md b/docs/operations/listguardrailkeyassignmentsrequest.md new file mode 100644 index 0000000..c6bc0f8 --- /dev/null +++ b/docs/operations/listguardrailkeyassignmentsrequest.md @@ -0,0 +1,10 @@ +# ListGuardrailKeyAssignmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listguardrailkeyassignmentsresponse.md b/docs/operations/listguardrailkeyassignmentsresponse.md new file mode 100644 index 0000000..90844cf --- /dev/null +++ b/docs/operations/listguardrailkeyassignmentsresponse.md @@ -0,0 +1,11 @@ +# ListGuardrailKeyAssignmentsResponse + +List of key assignments + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `data` | List[[operations.ListGuardrailKeyAssignmentsData](../operations/listguardrailkeyassignmentsdata.md)] | :heavy_check_mark: | List of key assignments | | +| `total_count` | *float* | :heavy_check_mark: | Total number of key assignments for this guardrail | 25 | \ No newline at end of file diff --git a/docs/operations/listguardrailmemberassignmentsdata.md b/docs/operations/listguardrailmemberassignmentsdata.md new file mode 100644 index 0000000..9b3be4f --- /dev/null +++ b/docs/operations/listguardrailmemberassignmentsdata.md @@ -0,0 +1,13 @@ +# ListGuardrailMemberAssignmentsData + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `user_id` | *str* | :heavy_check_mark: | Clerk user ID of the assigned member | user_abc123 | +| `organization_id` | *str* | :heavy_check_mark: | Organization ID | org_xyz789 | +| `guardrail_id` | *str* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `assigned_by` | *Nullable[str]* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/operations/listguardrailmemberassignmentsrequest.md b/docs/operations/listguardrailmemberassignmentsrequest.md new file mode 100644 index 0000000..e3ce4aa --- /dev/null +++ b/docs/operations/listguardrailmemberassignmentsrequest.md @@ -0,0 +1,10 @@ +# ListGuardrailMemberAssignmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listguardrailmemberassignmentsresponse.md b/docs/operations/listguardrailmemberassignmentsresponse.md new file mode 100644 index 0000000..ae1be1a --- /dev/null +++ b/docs/operations/listguardrailmemberassignmentsresponse.md @@ -0,0 +1,11 @@ +# ListGuardrailMemberAssignmentsResponse + +List of member assignments + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `data` | List[[operations.ListGuardrailMemberAssignmentsData](../operations/listguardrailmemberassignmentsdata.md)] | :heavy_check_mark: | List of member assignments | | +| `total_count` | *float* | :heavy_check_mark: | Total number of member assignments | 10 | \ No newline at end of file diff --git a/docs/operations/listguardrailsdata.md b/docs/operations/listguardrailsdata.md new file mode 100644 index 0000000..7457408 --- /dev/null +++ b/docs/operations/listguardrailsdata.md @@ -0,0 +1,17 @@ +# ListGuardrailsData + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `reset_interval` | [OptionalNullable[operations.ListGuardrailsResetInterval]](../operations/listguardrailsresetinterval.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/operations/listguardrailsrequest.md b/docs/operations/listguardrailsrequest.md new file mode 100644 index 0000000..19317a1 --- /dev/null +++ b/docs/operations/listguardrailsrequest.md @@ -0,0 +1,9 @@ +# ListGuardrailsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listguardrailsresetinterval.md b/docs/operations/listguardrailsresetinterval.md new file mode 100644 index 0000000..0c651fc --- /dev/null +++ b/docs/operations/listguardrailsresetinterval.md @@ -0,0 +1,12 @@ +# ListGuardrailsResetInterval + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/getparametersdata.md b/docs/operations/listguardrailsresponse.md similarity index 53% rename from docs/operations/getparametersdata.md rename to docs/operations/listguardrailsresponse.md index e3a0c3d..ceb6728 100644 --- a/docs/operations/getparametersdata.md +++ b/docs/operations/listguardrailsresponse.md @@ -1,11 +1,11 @@ -# GetParametersData +# ListGuardrailsResponse -Parameter analytics data +List of guardrails ## Fields | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `model` | *str* | :heavy_check_mark: | Model identifier | openai/gpt-4 | -| `supported_parameters` | List[[operations.SupportedParameter](../operations/supportedparameter.md)] | :heavy_check_mark: | List of parameters supported by this model | [
"temperature",
"top_p",
"max_tokens"
] | \ No newline at end of file +| `data` | List[[operations.ListGuardrailsData](../operations/listguardrailsdata.md)] | :heavy_check_mark: | List of guardrails | | +| `total_count` | *float* | :heavy_check_mark: | Total number of guardrails | 25 | \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsdata.md b/docs/operations/listkeyassignmentsdata.md new file mode 100644 index 0000000..fa93d0d --- /dev/null +++ b/docs/operations/listkeyassignmentsdata.md @@ -0,0 +1,14 @@ +# ListKeyAssignmentsData + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `key_hash` | *str* | :heavy_check_mark: | Hash of the assigned API key | c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93 | +| `guardrail_id` | *str* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `key_name` | *str* | :heavy_check_mark: | Name of the API key | Production Key | +| `key_label` | *str* | :heavy_check_mark: | Label of the API key | prod-key | +| `assigned_by` | *Nullable[str]* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsrequest.md b/docs/operations/listkeyassignmentsrequest.md new file mode 100644 index 0000000..fafdeeb --- /dev/null +++ b/docs/operations/listkeyassignmentsrequest.md @@ -0,0 +1,9 @@ +# ListKeyAssignmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listkeyassignmentsresponse.md b/docs/operations/listkeyassignmentsresponse.md new file mode 100644 index 0000000..9f6529c --- /dev/null +++ b/docs/operations/listkeyassignmentsresponse.md @@ -0,0 +1,11 @@ +# ListKeyAssignmentsResponse + +List of key assignments + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `data` | List[[operations.ListKeyAssignmentsData](../operations/listkeyassignmentsdata.md)] | :heavy_check_mark: | List of key assignments | | +| `total_count` | *float* | :heavy_check_mark: | Total number of key assignments for this guardrail | 25 | \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsdata.md b/docs/operations/listmemberassignmentsdata.md new file mode 100644 index 0000000..9d95d1e --- /dev/null +++ b/docs/operations/listmemberassignmentsdata.md @@ -0,0 +1,13 @@ +# ListMemberAssignmentsData + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the assignment | 550e8400-e29b-41d4-a716-446655440000 | +| `user_id` | *str* | :heavy_check_mark: | Clerk user ID of the assigned member | user_abc123 | +| `organization_id` | *str* | :heavy_check_mark: | Organization ID | org_xyz789 | +| `guardrail_id` | *str* | :heavy_check_mark: | ID of the guardrail | 550e8400-e29b-41d4-a716-446655440001 | +| `assigned_by` | *Nullable[str]* | :heavy_check_mark: | User ID of who made the assignment | user_abc123 | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the assignment was created | 2025-08-24T10:30:00Z | \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsrequest.md b/docs/operations/listmemberassignmentsrequest.md new file mode 100644 index 0000000..083455d --- /dev/null +++ b/docs/operations/listmemberassignmentsrequest.md @@ -0,0 +1,9 @@ +# ListMemberAssignmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | \ No newline at end of file diff --git a/docs/operations/listmemberassignmentsresponse.md b/docs/operations/listmemberassignmentsresponse.md new file mode 100644 index 0000000..6a05f64 --- /dev/null +++ b/docs/operations/listmemberassignmentsresponse.md @@ -0,0 +1,11 @@ +# ListMemberAssignmentsResponse + +List of member assignments + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `data` | List[[operations.ListMemberAssignmentsData](../operations/listmemberassignmentsdata.md)] | :heavy_check_mark: | List of member assignments | | +| `total_count` | *float* | :heavy_check_mark: | Total number of member assignments | 10 | \ No newline at end of file diff --git a/docs/operations/supportedparameter.md b/docs/operations/supportedparameter.md deleted file mode 100644 index 219529f..0000000 --- a/docs/operations/supportedparameter.md +++ /dev/null @@ -1,31 +0,0 @@ -# SupportedParameter - - -## Values - -| Name | Value | -| --------------------- | --------------------- | -| `TEMPERATURE` | temperature | -| `TOP_P` | top_p | -| `TOP_K` | top_k | -| `MIN_P` | min_p | -| `TOP_A` | top_a | -| `FREQUENCY_PENALTY` | frequency_penalty | -| `PRESENCE_PENALTY` | presence_penalty | -| `REPETITION_PENALTY` | repetition_penalty | -| `MAX_TOKENS` | max_tokens | -| `LOGIT_BIAS` | logit_bias | -| `LOGPROBS` | logprobs | -| `TOP_LOGPROBS` | top_logprobs | -| `SEED` | seed | -| `RESPONSE_FORMAT` | response_format | -| `STRUCTURED_OUTPUTS` | structured_outputs | -| `STOP` | stop | -| `TOOLS` | tools | -| `TOOL_CHOICE` | tool_choice | -| `PARALLEL_TOOL_CALLS` | parallel_tool_calls | -| `INCLUDE_REASONING` | include_reasoning | -| `REASONING` | reasoning | -| `REASONING_EFFORT` | reasoning_effort | -| `WEB_SEARCH_OPTIONS` | web_search_options | -| `VERBOSITY` | verbosity | \ No newline at end of file diff --git a/docs/operations/updateguardraildata.md b/docs/operations/updateguardraildata.md new file mode 100644 index 0000000..8ef0a03 --- /dev/null +++ b/docs/operations/updateguardraildata.md @@ -0,0 +1,19 @@ +# UpdateGuardrailData + +The updated guardrail + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *str* | :heavy_check_mark: | Name of the guardrail | Production Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | Guardrail for production environment | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 100 | +| `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalResponse]](../operations/updateguardrailresetintervalresponse.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"google"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model canonical_slugs (immutable identifiers) | [
"openai/gpt-5.2-20251211",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the guardrail was created | 2025-08-24T10:30:00Z | +| `updated_at` | *OptionalNullable[str]* | :heavy_minus_sign: | ISO 8601 timestamp of when the guardrail was last updated | 2025-08-24T15:45:00Z | \ No newline at end of file diff --git a/docs/operations/updateguardrailrequest.md b/docs/operations/updateguardrailrequest.md new file mode 100644 index 0000000..2f54d43 --- /dev/null +++ b/docs/operations/updateguardrailrequest.md @@ -0,0 +1,9 @@ +# UpdateGuardrailRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | +| `request_body` | [operations.UpdateGuardrailRequestBody](../operations/updateguardrailrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated Guardrail Name",
"description": "Updated description",
"limit_usd": 75,
"reset_interval": "weekly"
} | \ No newline at end of file diff --git a/docs/operations/updateguardrailrequestbody.md b/docs/operations/updateguardrailrequestbody.md new file mode 100644 index 0000000..fe16a07 --- /dev/null +++ b/docs/operations/updateguardrailrequestbody.md @@ -0,0 +1,14 @@ +# UpdateGuardrailRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | +| `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalRequest]](../operations/updateguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | true | \ No newline at end of file diff --git a/docs/operations/updateguardrailresetintervalrequest.md b/docs/operations/updateguardrailresetintervalrequest.md new file mode 100644 index 0000000..b48624a --- /dev/null +++ b/docs/operations/updateguardrailresetintervalrequest.md @@ -0,0 +1,12 @@ +# UpdateGuardrailResetIntervalRequest + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/updateguardrailresetintervalresponse.md b/docs/operations/updateguardrailresetintervalresponse.md new file mode 100644 index 0000000..64ccf85 --- /dev/null +++ b/docs/operations/updateguardrailresetintervalresponse.md @@ -0,0 +1,12 @@ +# UpdateGuardrailResetIntervalResponse + +Interval at which the limit resets (daily, weekly, monthly) + + +## Values + +| Name | Value | +| --------- | --------- | +| `DAILY` | daily | +| `WEEKLY` | weekly | +| `MONTHLY` | monthly | \ No newline at end of file diff --git a/docs/operations/updateguardrailresponse.md b/docs/operations/updateguardrailresponse.md new file mode 100644 index 0000000..c068ca8 --- /dev/null +++ b/docs/operations/updateguardrailresponse.md @@ -0,0 +1,10 @@ +# UpdateGuardrailResponse + +Guardrail updated successfully + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateGuardrailData](../operations/updateguardraildata.md) | :heavy_check_mark: | The updated guardrail | {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production Guardrail",
"description": "Guardrail for production environment",
"limit_usd": 100,
"reset_interval": "monthly",
"allowed_providers": [
"openai",
"anthropic",
"google"
],
"allowed_models": null,
"enforce_zdr": false,
"created_at": "2025-08-24T10:30:00Z",
"updated_at": "2025-08-24T15:45:00Z"
} | \ No newline at end of file diff --git a/docs/operations/updatekeysdata.md b/docs/operations/updatekeysdata.md index 90fd068..9105534 100644 --- a/docs/operations/updatekeysdata.md +++ b/docs/operations/updatekeysdata.md @@ -7,9 +7,9 @@ The updated API key information | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | 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 | +| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key | -| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | Production API Key | +| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | sk-or-v1-0e6...1c96 | | `disabled` | *bool* | :heavy_check_mark: | Whether the API key is disabled | false | | `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 | | `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 | diff --git a/docs/operations/updatekeysrequest.md b/docs/operations/updatekeysrequest.md index ff908da..8ef80cc 100644 --- a/docs/operations/updatekeysrequest.md +++ b/docs/operations/updatekeysrequest.md @@ -5,5 +5,5 @@ | 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 | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `request_body` | [operations.UpdateKeysRequestBody](../operations/updatekeysrequestbody.md) | :heavy_check_mark: | N/A | {
"name": "Updated API Key Name",
"disabled": false,
"limit": 75,
"limit_reset": "daily",
"include_byok_in_limit": true
} | \ No newline at end of file diff --git a/docs/operations/updatekeysresponse.md b/docs/operations/updatekeysresponse.md index 9509469..6f58ec3 100644 --- a/docs/operations/updatekeysresponse.md +++ b/docs/operations/updatekeysresponse.md @@ -5,6 +5,6 @@ API key updated successfully ## Fields -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [operations.UpdateKeysData](../operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"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"
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `data` | [operations.UpdateKeysData](../operations/updatekeysdata.md) | :heavy_check_mark: | The updated API key information | {
"hash": "f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943",
"name": "My Production Key",
"label": "sk-or-v1-0e6...1c96",
"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"
} | \ No newline at end of file diff --git a/docs/sdks/analytics/README.md b/docs/sdks/analytics/README.md index 8b27ed7..4530c8f 100644 --- a/docs/sdks/analytics/README.md +++ b/docs/sdks/analytics/README.md @@ -11,7 +11,7 @@ Analytics and usage endpoints ## get_user_activity -Returns user activity data grouped by endpoint for the last 30 (completed) UTC days +Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage diff --git a/docs/sdks/apikeys/README.md b/docs/sdks/apikeys/README.md index 303ac8f..aae9b09 100644 --- a/docs/sdks/apikeys/README.md +++ b/docs/sdks/apikeys/README.md @@ -16,7 +16,7 @@ API key management endpoints ## list -List API keys +List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -60,7 +60,7 @@ with OpenRouter( ## create -Create a new API key +Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -108,7 +108,7 @@ with OpenRouter( ## update -Update an API key +Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -122,7 +122,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.api_keys.update(hash="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") + res = open_router.api_keys.update(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943") # Handle response print(res) @@ -133,7 +133,7 @@ with OpenRouter( | Parameter | 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 | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | | `name` | *Optional[str]* | :heavy_minus_sign: | New name for the API key | Updated API Key Name | | `disabled` | *Optional[bool]* | :heavy_minus_sign: | Whether to disable the API key | false | | `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit for the API key in USD | 75 | @@ -158,7 +158,7 @@ with OpenRouter( ## delete -Delete an API key +Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -172,7 +172,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.api_keys.delete(hash="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") + res = open_router.api_keys.delete(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943") # Handle response print(res) @@ -181,10 +181,10 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | 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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response @@ -202,7 +202,7 @@ with OpenRouter( ## get -Get a single API key +Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage @@ -216,7 +216,7 @@ with OpenRouter( api_key=os.getenv("OPENROUTER_API_KEY", ""), ) as open_router: - res = open_router.api_keys.get(hash="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") + res = open_router.api_keys.get(hash="f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943") # Handle response print(res) @@ -225,10 +225,10 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | 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 | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/credits/README.md b/docs/sdks/credits/README.md index 6136956..083195b 100644 --- a/docs/sdks/credits/README.md +++ b/docs/sdks/credits/README.md @@ -12,7 +12,7 @@ Credit management endpoints ## get_credits -Get total credits purchased and used for the authenticated user +Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. ### Example Usage diff --git a/docs/sdks/guardrails/README.md b/docs/sdks/guardrails/README.md new file mode 100644 index 0000000..2b5c029 --- /dev/null +++ b/docs/sdks/guardrails/README.md @@ -0,0 +1,617 @@ +# Guardrails +(*guardrails*) + +## Overview + +Guardrails endpoints + +### Available Operations + +* [list](#list) - List guardrails +* [create](#create) - Create a guardrail +* [get](#get) - Get a guardrail +* [update](#update) - Update a guardrail +* [delete](#delete) - Delete a guardrail +* [list_key_assignments](#list_key_assignments) - List all key assignments +* [list_member_assignments](#list_member_assignments) - List all member assignments +* [list_guardrail_key_assignments](#list_guardrail_key_assignments) - List key assignments for a guardrail +* [bulk_assign_keys](#bulk_assign_keys) - Bulk assign keys to a guardrail +* [list_guardrail_member_assignments](#list_guardrail_member_assignments) - List member assignments for a guardrail +* [bulk_assign_members](#bulk_assign_members) - Bulk assign members to a guardrail +* [bulk_unassign_keys](#bulk_unassign_keys) - Bulk unassign keys from a guardrail +* [bulk_unassign_members](#bulk_unassign_members) - Bulk unassign members from a guardrail + +## list + +List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.list() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListGuardrailsResponse](../../operations/listguardrailsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## create + +Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.create(name="My New Guardrail") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | Spending limit in USD | 50 | +| `reset_interval` | [OptionalNullable[operations.CreateGuardrailResetIntervalRequest]](../../operations/createguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.CreateGuardrailResponse](../../operations/createguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## get + +Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.get(id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.GetGuardrailResponse](../../operations/getguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## update + +Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.update(id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 | +| `name` | *Optional[str]* | :heavy_minus_sign: | New name for the guardrail | Updated Guardrail Name | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | +| `limit_usd` | *OptionalNullable[float]* | :heavy_minus_sign: | New spending limit in USD | 75 | +| `reset_interval` | [OptionalNullable[operations.UpdateGuardrailResetIntervalRequest]](../../operations/updateguardrailresetintervalrequest.md) | :heavy_minus_sign: | Interval at which the limit resets (daily, weekly, monthly) | monthly | +| `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | +| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | +| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | true | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.UpdateGuardrailResponse](../../operations/updateguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## delete + +Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.delete(id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.DeleteGuardrailResponse](../../operations/deleteguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## list_key_assignments + +List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.list_key_assignments() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListKeyAssignmentsResponse](../../operations/listkeyassignmentsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## list_member_assignments + +List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.list_member_assignments() + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListMemberAssignmentsResponse](../../operations/listmemberassignmentsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## list_guardrail_key_assignments + +List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.list_guardrail_key_assignments(id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListGuardrailKeyAssignmentsResponse](../../operations/listguardrailkeyassignmentsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulk_assign_keys + +Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.bulk_assign_keys(id="550e8400-e29b-41d4-a716-446655440000", key_hashes=[ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to assign to the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.BulkAssignKeysToGuardrailResponse](../../operations/bulkassignkeystoguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## list_guardrail_member_assignments + +List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.list_guardrail_member_assignments(id="550e8400-e29b-41d4-a716-446655440000") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of records to skip for pagination | 0 | +| `limit` | *Optional[str]* | :heavy_minus_sign: | Maximum number of records to return (max 100) | 50 | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.ListGuardrailMemberAssignmentsResponse](../../operations/listguardrailmemberassignmentsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulk_assign_members + +Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.bulk_assign_members(id="550e8400-e29b-41d4-a716-446655440000", member_user_ids=[ + "user_abc123", + "user_def456", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to assign to the guardrail | [
"user_abc123",
"user_def456"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.BulkAssignMembersToGuardrailResponse](../../operations/bulkassignmemberstoguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulk_unassign_keys + +Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.bulk_unassign_keys(id="550e8400-e29b-41d4-a716-446655440000", key_hashes=[ + "c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `key_hashes` | List[*str*] | :heavy_check_mark: | Array of API key hashes to unassign from the guardrail | [
"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.BulkUnassignKeysFromGuardrailResponse](../../operations/bulkunassignkeysfromguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | + +## bulk_unassign_members + +Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + +### Example Usage + + +```python +from openrouter import OpenRouter +import os + + +with OpenRouter( + api_key=os.getenv("OPENROUTER_API_KEY", ""), +) as open_router: + + res = open_router.guardrails.bulk_unassign_members(id="550e8400-e29b-41d4-a716-446655440000", member_user_ids=[ + "user_abc123", + "user_def456", + ]) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 | +| `member_user_ids` | List[*str*] | :heavy_check_mark: | Array of member user IDs to unassign from the guardrail | [
"user_abc123",
"user_def456"
] | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | + +### Response + +**[operations.BulkUnassignMembersFromGuardrailResponse](../../operations/bulkunassignmembersfromguardrailresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| errors.BadRequestResponseError | 400 | application/json | +| errors.UnauthorizedResponseError | 401 | application/json | +| errors.NotFoundResponseError | 404 | application/json | +| errors.InternalServerResponseError | 500 | application/json | +| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/models/README.md b/docs/sdks/models/README.md index dd45ad1..b106323 100644 --- a/docs/sdks/models/README.md +++ b/docs/sdks/models/README.md @@ -76,11 +76,11 @@ with OpenRouter( ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `category` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `category` | [Optional[operations.Category]](../../operations/category.md) | :heavy_minus_sign: | Filter models by use case category | programming | +| `supported_parameters` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | ### Response diff --git a/docs/sdks/parameters/README.md b/docs/sdks/parameters/README.md deleted file mode 100644 index 41db61a..0000000 --- a/docs/sdks/parameters/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Parameters -(*parameters*) - -## Overview - -Parameters endpoints - -### Available Operations - -* [get_parameters](#get_parameters) - Get a model's supported parameters and data about which are most popular - -## get_parameters - -Get a model's supported parameters and data about which are most popular - -### Example Usage - - -```python -from openrouter import OpenRouter, operations -import os - - -with OpenRouter() as open_router: - - res = open_router.parameters.get_parameters(security=operations.GetParametersSecurity( - bearer=os.getenv("OPENROUTER_BEARER", ""), - ), author="", slug="") - - # Handle response - print(res) - -``` - -### Parameters - -| Parameter | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `security` | [operations.GetParametersSecurity](../../operations/getparameterssecurity.md) | :heavy_check_mark: | N/A | | -| `author` | *str* | :heavy_check_mark: | N/A | | -| `slug` | *str* | :heavy_check_mark: | N/A | | -| `provider` | [Optional[components.ProviderName]](../../components/providername.md) | :heavy_minus_sign: | N/A | OpenAI | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | | - -### Response - -**[operations.GetParametersResponse](../../operations/getparametersresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | -| errors.UnauthorizedResponseError | 401 | application/json | -| errors.NotFoundResponseError | 404 | application/json | -| errors.InternalServerResponseError | 500 | application/json | -| errors.OpenRouterDefaultError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/output.zip b/output.zip new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 7b78171..09db2ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.1.2" +version = "0.1.3" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/scripts/check_types.py b/scripts/check_types.py new file mode 100644 index 0000000..0c9b552 --- /dev/null +++ b/scripts/check_types.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 +""" +Check if model types are stale. + +This script is intended to be run as a postinstall hook to warn users +when their generated types are outdated (similar to update-browserslist-db). + +It compares the MODEL_HASH in the generated types file with a freshly +computed hash from the OpenRouter API. + +Exit codes: +- 0: Types are up to date OR check was skipped (CI, disabled, errors) +- Does NOT fail on stale types to avoid breaking installs +""" + +import hashlib +import json +import os +import re +import sys +import urllib.request +from pathlib import Path + +API_URL = "https://openrouter.ai/api/v1/models" +TIMEOUT_SECONDS = 5 + + +def compute_hash(model_ids: list[str]) -> str: + """Compute SHA-256 hash of sorted model IDs (first 16 chars).""" + sorted_ids = sorted(model_ids) + content = "\n".join(sorted_ids) + hash_obj = hashlib.sha256(content.encode()) + return hash_obj.hexdigest()[:16] + + +def extract_hash(content: str) -> str | None: + """Extract MODEL_HASH from types file content.""" + match = re.search(r"MODEL_HASH: str = '([a-f0-9]+)'", content) + return match.group(1) if match else None + + +def fetch_models() -> list[str]: + """Fetch model IDs from OpenRouter API.""" + request = urllib.request.Request(API_URL) + with urllib.request.urlopen(request, timeout=TIMEOUT_SECONDS) as response: + data = json.loads(response.read().decode()) + return [model["id"] for model in data["data"]] + + +def main() -> None: + # Skip in CI environments + if os.environ.get("CI"): + return + + # Skip if explicitly disabled + if os.environ.get("OPENROUTER_SKIP_TYPE_CHECK"): + return + + try: + # Find the types file + script_dir = Path(__file__).parent + types_file = script_dir.parent / "src" / "openrouter" / "types" / "models.py" + + # Read existing hash + try: + content = types_file.read_text() + existing_hash = extract_hash(content) + except FileNotFoundError: + # Types file doesn't exist - expected for fresh installs + return + + if not existing_hash: + # No hash found - unusual, but don't warn + return + + # Fetch current models and compute hash + model_ids = fetch_models() + current_hash = compute_hash(model_ids) + + # Compare hashes + if existing_hash != current_hash: + print( + "\n\033[33m" # Yellow color + "OpenRouter model types are outdated.\n" + "Run: npx @openrouter/cli types\n" + "\033[0m", # Reset color + file=sys.stderr, + ) + + except Exception: + # Silently ignore errors - don't break installs + # Network errors, timeouts, etc. are expected in some environments + pass + + +if __name__ == "__main__": + main() diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index af00480..59cb4ed 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.1.2" +__version__: str = "0.1.3" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.768.0" -__user_agent__: str = "speakeasy-sdk/python 0.1.2 2.768.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.1.3 2.768.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/analytics.py b/src/openrouter/analytics.py index a60430c..ac1280b 100644 --- a/src/openrouter/analytics.py +++ b/src/openrouter/analytics.py @@ -23,7 +23,7 @@ class Analytics(BaseSDK): ) -> operations.GetUserActivityResponse: r"""Get user activity grouped by endpoint - Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. :param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). :param retries: Override the default retry configuration for this method @@ -132,7 +132,7 @@ class Analytics(BaseSDK): ) -> operations.GetUserActivityResponse: r"""Get user activity grouped by endpoint - Returns user activity data grouped by endpoint for the last 30 (completed) UTC days + Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. :param date_: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). :param retries: Override the default retry configuration for this method diff --git a/src/openrouter/api_keys.py b/src/openrouter/api_keys.py index 39bbe5f..9615b37 100644 --- a/src/openrouter/api_keys.py +++ b/src/openrouter/api_keys.py @@ -25,6 +25,8 @@ class APIKeys(BaseSDK): ) -> operations.ListResponse: r"""List API keys + List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param include_disabled: Whether to include disabled API keys in the response :param offset: Number of API keys to skip for pagination :param retries: Override the default retry configuration for this method @@ -130,6 +132,8 @@ class APIKeys(BaseSDK): ) -> operations.ListResponse: r"""List API keys + List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param include_disabled: Whether to include disabled API keys in the response :param offset: Number of API keys to skip for pagination :param retries: Override the default retry configuration for this method @@ -238,6 +242,8 @@ class APIKeys(BaseSDK): ) -> operations.CreateKeysResponse: r"""Create a new API key + Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param name: Name for the new API key :param limit: Optional spending limit for the API key in USD :param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. @@ -360,6 +366,8 @@ class APIKeys(BaseSDK): ) -> operations.CreateKeysResponse: r"""Create a new API key + Create a new API key for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param name: Name for the new API key :param limit: Optional spending limit for the API key in USD :param limit_reset: Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. @@ -483,6 +491,8 @@ class APIKeys(BaseSDK): ) -> operations.UpdateKeysResponse: r"""Update an API key + Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to update :param name: New name for the API key :param disabled: Whether to disable the API key @@ -619,6 +629,8 @@ class APIKeys(BaseSDK): ) -> operations.UpdateKeysResponse: r"""Update an API key + Update an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to update :param name: New name for the API key :param disabled: Whether to disable the API key @@ -750,6 +762,8 @@ class APIKeys(BaseSDK): ) -> operations.DeleteKeysResponse: r"""Delete an API key + Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to delete :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -857,6 +871,8 @@ class APIKeys(BaseSDK): ) -> operations.DeleteKeysResponse: r"""Delete an API key + Delete an existing API key. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to delete :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -964,6 +980,8 @@ class APIKeys(BaseSDK): ) -> operations.GetKeyResponse: r"""Get a single API key + Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to retrieve :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1071,6 +1089,8 @@ class APIKeys(BaseSDK): ) -> operations.GetKeyResponse: r"""Get a single API key + Get a single API key by hash. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + :param hash: The hash identifier of the API key to retrieve :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 4a1d650..94e838c 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -7,23 +7,27 @@ import sys if TYPE_CHECKING: from ._schema0 import Schema0, Schema0Enum, Schema0TypedDict - from ._schema3 import ( - Schema3, - Schema3ReasoningEncrypted, - Schema3ReasoningEncryptedTypedDict, - Schema3ReasoningSummary, - Schema3ReasoningSummaryTypedDict, - Schema3ReasoningText, - Schema3ReasoningTextTypedDict, - Schema3TypedDict, - Schema5, + from ._schema2 import ( + Schema2, + Schema2ReasoningEncrypted, + Schema2ReasoningEncryptedTypedDict, + Schema2ReasoningSummary, + Schema2ReasoningSummaryTypedDict, + Schema2ReasoningText, + Schema2ReasoningTextTypedDict, + Schema2TypedDict, + Schema4, ) from .activityitem import ActivityItem, ActivityItemTypedDict from .assistantmessage import ( AssistantMessage, AssistantMessageContent, AssistantMessageContentTypedDict, + AssistantMessageImageURL, + AssistantMessageImageURLTypedDict, AssistantMessageTypedDict, + Image, + ImageTypedDict, ) from .badgatewayresponseerrordata import ( BadGatewayResponseErrorData, @@ -114,9 +118,9 @@ if TYPE_CHECKING: from .chatmessagecontentitemimage import ( ChatMessageContentItemImage, ChatMessageContentItemImageDetail, + ChatMessageContentItemImageImageURL, + ChatMessageContentItemImageImageURLTypedDict, ChatMessageContentItemImageTypedDict, - ImageURL, - ImageURLTypedDict, ) from .chatmessagecontentitemtext import ( ChatMessageContentItemText, @@ -913,6 +917,8 @@ __all__ = [ "AssistantMessage", "AssistantMessageContent", "AssistantMessageContentTypedDict", + "AssistantMessageImageURL", + "AssistantMessageImageURLTypedDict", "AssistantMessageTypedDict", "BadGatewayResponseErrorData", "BadGatewayResponseErrorDataTypedDict", @@ -972,6 +978,8 @@ __all__ = [ "ChatMessageContentItemCacheControlTypedDict", "ChatMessageContentItemImage", "ChatMessageContentItemImageDetail", + "ChatMessageContentItemImageImageURL", + "ChatMessageContentItemImageImageURLTypedDict", "ChatMessageContentItemImageTypedDict", "ChatMessageContentItemText", "ChatMessageContentItemTextTypedDict", @@ -1066,9 +1074,9 @@ __all__ = [ "IDModeration", "IDResponseHealing", "IDWeb", + "Image", "ImageGenerationStatus", - "ImageURL", - "ImageURLTypedDict", + "ImageTypedDict", "InputModality", "InputTokensDetails", "InputTokensDetailsTypedDict", @@ -1540,15 +1548,15 @@ __all__ = [ "Schema0", "Schema0Enum", "Schema0TypedDict", - "Schema3", - "Schema3ReasoningEncrypted", - "Schema3ReasoningEncryptedTypedDict", - "Schema3ReasoningSummary", - "Schema3ReasoningSummaryTypedDict", - "Schema3ReasoningText", - "Schema3ReasoningTextTypedDict", - "Schema3TypedDict", - "Schema5", + "Schema2", + "Schema2ReasoningEncrypted", + "Schema2ReasoningEncryptedTypedDict", + "Schema2ReasoningSummary", + "Schema2ReasoningSummaryTypedDict", + "Schema2ReasoningText", + "Schema2ReasoningTextTypedDict", + "Schema2TypedDict", + "Schema4", "Security", "SecurityTypedDict", "ServiceTier", @@ -1624,21 +1632,25 @@ _dynamic_imports: dict[str, str] = { "Schema0": "._schema0", "Schema0Enum": "._schema0", "Schema0TypedDict": "._schema0", - "Schema3": "._schema3", - "Schema3ReasoningEncrypted": "._schema3", - "Schema3ReasoningEncryptedTypedDict": "._schema3", - "Schema3ReasoningSummary": "._schema3", - "Schema3ReasoningSummaryTypedDict": "._schema3", - "Schema3ReasoningText": "._schema3", - "Schema3ReasoningTextTypedDict": "._schema3", - "Schema3TypedDict": "._schema3", - "Schema5": "._schema3", + "Schema2": "._schema2", + "Schema2ReasoningEncrypted": "._schema2", + "Schema2ReasoningEncryptedTypedDict": "._schema2", + "Schema2ReasoningSummary": "._schema2", + "Schema2ReasoningSummaryTypedDict": "._schema2", + "Schema2ReasoningText": "._schema2", + "Schema2ReasoningTextTypedDict": "._schema2", + "Schema2TypedDict": "._schema2", + "Schema4": "._schema2", "ActivityItem": ".activityitem", "ActivityItemTypedDict": ".activityitem", "AssistantMessage": ".assistantmessage", "AssistantMessageContent": ".assistantmessage", "AssistantMessageContentTypedDict": ".assistantmessage", + "AssistantMessageImageURL": ".assistantmessage", + "AssistantMessageImageURLTypedDict": ".assistantmessage", "AssistantMessageTypedDict": ".assistantmessage", + "Image": ".assistantmessage", + "ImageTypedDict": ".assistantmessage", "BadGatewayResponseErrorData": ".badgatewayresponseerrordata", "BadGatewayResponseErrorDataTypedDict": ".badgatewayresponseerrordata", "BadRequestResponseErrorData": ".badrequestresponseerrordata", @@ -1716,9 +1728,9 @@ _dynamic_imports: dict[str, str] = { "TTL": ".chatmessagecontentitemcachecontrol", "ChatMessageContentItemImage": ".chatmessagecontentitemimage", "ChatMessageContentItemImageDetail": ".chatmessagecontentitemimage", + "ChatMessageContentItemImageImageURL": ".chatmessagecontentitemimage", + "ChatMessageContentItemImageImageURLTypedDict": ".chatmessagecontentitemimage", "ChatMessageContentItemImageTypedDict": ".chatmessagecontentitemimage", - "ImageURL": ".chatmessagecontentitemimage", - "ImageURLTypedDict": ".chatmessagecontentitemimage", "ChatMessageContentItemText": ".chatmessagecontentitemtext", "ChatMessageContentItemTextTypedDict": ".chatmessagecontentitemtext", "ChatMessageContentItemVideo": ".chatmessagecontentitemvideo", diff --git a/src/openrouter/components/_schema3.py b/src/openrouter/components/_schema2.py similarity index 84% rename from src/openrouter/components/_schema3.py rename to src/openrouter/components/_schema2.py index 84a7df8..faec5d8 100644 --- a/src/openrouter/components/_schema3.py +++ b/src/openrouter/components/_schema2.py @@ -17,7 +17,7 @@ from typing import Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -Schema5 = Union[ +Schema4 = Union[ Literal[ "unknown", "openai-responses-v1", @@ -30,16 +30,16 @@ Schema5 = Union[ ] -class Schema3ReasoningTextTypedDict(TypedDict): +class Schema2ReasoningTextTypedDict(TypedDict): type: Literal["reasoning.text"] text: NotRequired[Nullable[str]] signature: NotRequired[Nullable[str]] id: NotRequired[Nullable[str]] - format_: NotRequired[Nullable[Schema5]] + format_: NotRequired[Nullable[Schema4]] index: NotRequired[float] -class Schema3ReasoningText(BaseModel): +class Schema2ReasoningText(BaseModel): TYPE: Annotated[ Annotated[ Literal["reasoning.text"], AfterValidator(validate_const("reasoning.text")) @@ -54,7 +54,7 @@ class Schema3ReasoningText(BaseModel): id: OptionalNullable[str] = UNSET format_: Annotated[ - Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))], pydantic.Field(alias="format"), ] = UNSET @@ -91,15 +91,15 @@ class Schema3ReasoningText(BaseModel): return m -class Schema3ReasoningEncryptedTypedDict(TypedDict): +class Schema2ReasoningEncryptedTypedDict(TypedDict): data: str type: Literal["reasoning.encrypted"] id: NotRequired[Nullable[str]] - format_: NotRequired[Nullable[Schema5]] + format_: NotRequired[Nullable[Schema4]] index: NotRequired[float] -class Schema3ReasoningEncrypted(BaseModel): +class Schema2ReasoningEncrypted(BaseModel): data: str TYPE: Annotated[ @@ -113,7 +113,7 @@ class Schema3ReasoningEncrypted(BaseModel): id: OptionalNullable[str] = UNSET format_: Annotated[ - Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))], pydantic.Field(alias="format"), ] = UNSET @@ -150,15 +150,15 @@ class Schema3ReasoningEncrypted(BaseModel): return m -class Schema3ReasoningSummaryTypedDict(TypedDict): +class Schema2ReasoningSummaryTypedDict(TypedDict): summary: str type: Literal["reasoning.summary"] id: NotRequired[Nullable[str]] - format_: NotRequired[Nullable[Schema5]] + format_: NotRequired[Nullable[Schema4]] index: NotRequired[float] -class Schema3ReasoningSummary(BaseModel): +class Schema2ReasoningSummary(BaseModel): summary: str TYPE: Annotated[ @@ -172,7 +172,7 @@ class Schema3ReasoningSummary(BaseModel): id: OptionalNullable[str] = UNSET format_: Annotated[ - Annotated[OptionalNullable[Schema5], PlainValidator(validate_open_enum(False))], + Annotated[OptionalNullable[Schema4], PlainValidator(validate_open_enum(False))], pydantic.Field(alias="format"), ] = UNSET @@ -209,21 +209,21 @@ class Schema3ReasoningSummary(BaseModel): return m -Schema3TypedDict = TypeAliasType( - "Schema3TypedDict", +Schema2TypedDict = TypeAliasType( + "Schema2TypedDict", Union[ - Schema3ReasoningSummaryTypedDict, - Schema3ReasoningEncryptedTypedDict, - Schema3ReasoningTextTypedDict, + Schema2ReasoningSummaryTypedDict, + Schema2ReasoningEncryptedTypedDict, + Schema2ReasoningTextTypedDict, ], ) -Schema3 = Annotated[ +Schema2 = Annotated[ Union[ - Annotated[Schema3ReasoningSummary, Tag("reasoning.summary")], - Annotated[Schema3ReasoningEncrypted, Tag("reasoning.encrypted")], - Annotated[Schema3ReasoningText, Tag("reasoning.text")], + Annotated[Schema2ReasoningSummary, Tag("reasoning.summary")], + Annotated[Schema2ReasoningEncrypted, Tag("reasoning.encrypted")], + Annotated[Schema2ReasoningText, Tag("reasoning.text")], ], Discriminator(lambda m: get_discriminator(m, "type", "type")), ] diff --git a/src/openrouter/components/assistantmessage.py b/src/openrouter/components/assistantmessage.py index b9a8d68..f9f4fa6 100644 --- a/src/openrouter/components/assistantmessage.py +++ b/src/openrouter/components/assistantmessage.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from ._schema2 import Schema2, Schema2TypedDict from .chatmessagecontentitem import ( ChatMessageContentItem, ChatMessageContentItemTypedDict, @@ -32,6 +33,22 @@ AssistantMessageContent = TypeAliasType( ) +class AssistantMessageImageURLTypedDict(TypedDict): + url: str + + +class AssistantMessageImageURL(BaseModel): + url: str + + +class ImageTypedDict(TypedDict): + image_url: AssistantMessageImageURLTypedDict + + +class Image(BaseModel): + image_url: AssistantMessageImageURL + + class AssistantMessageTypedDict(TypedDict): role: Literal["assistant"] content: NotRequired[Nullable[AssistantMessageContentTypedDict]] @@ -39,6 +56,8 @@ class AssistantMessageTypedDict(TypedDict): tool_calls: NotRequired[List[ChatMessageToolCallTypedDict]] refusal: NotRequired[Nullable[str]] reasoning: NotRequired[Nullable[str]] + reasoning_details: NotRequired[List[Schema2TypedDict]] + images: NotRequired[List[ImageTypedDict]] class AssistantMessage(BaseModel): @@ -57,9 +76,21 @@ class AssistantMessage(BaseModel): reasoning: OptionalNullable[str] = UNSET + reasoning_details: Optional[List[Schema2]] = None + + images: Optional[List[Image]] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["content", "name", "tool_calls", "refusal", "reasoning"] + optional_fields = [ + "content", + "name", + "tool_calls", + "refusal", + "reasoning", + "reasoning_details", + "images", + ] nullable_fields = ["content", "refusal", "reasoning"] null_default_fields = [] diff --git a/src/openrouter/components/chatmessagecontentitemimage.py b/src/openrouter/components/chatmessagecontentitemimage.py index 997f4ef..8e5d5a4 100644 --- a/src/openrouter/components/chatmessagecontentitemimage.py +++ b/src/openrouter/components/chatmessagecontentitemimage.py @@ -19,12 +19,12 @@ ChatMessageContentItemImageDetail = Union[ ] -class ImageURLTypedDict(TypedDict): +class ChatMessageContentItemImageImageURLTypedDict(TypedDict): url: str detail: NotRequired[ChatMessageContentItemImageDetail] -class ImageURL(BaseModel): +class ChatMessageContentItemImageImageURL(BaseModel): url: str detail: Annotated[ @@ -34,12 +34,12 @@ class ImageURL(BaseModel): class ChatMessageContentItemImageTypedDict(TypedDict): - image_url: ImageURLTypedDict + image_url: ChatMessageContentItemImageImageURLTypedDict type: Literal["image_url"] class ChatMessageContentItemImage(BaseModel): - image_url: ImageURL + image_url: ChatMessageContentItemImageImageURL TYPE: Annotated[ Annotated[Literal["image_url"], AfterValidator(validate_const("image_url"))], diff --git a/src/openrouter/components/chatresponsechoice.py b/src/openrouter/components/chatresponsechoice.py index 9696904..9592bf1 100644 --- a/src/openrouter/components/chatresponsechoice.py +++ b/src/openrouter/components/chatresponsechoice.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from ._schema3 import Schema3, Schema3TypedDict from .assistantmessage import AssistantMessage, AssistantMessageTypedDict from .chatcompletionfinishreason import ChatCompletionFinishReason from .chatmessagetokenlogprobs import ( @@ -18,7 +17,6 @@ from openrouter.types import ( from openrouter.utils import validate_open_enum from pydantic import model_serializer from pydantic.functional_validators import PlainValidator -from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict @@ -26,7 +24,6 @@ class ChatResponseChoiceTypedDict(TypedDict): finish_reason: Nullable[ChatCompletionFinishReason] index: float message: AssistantMessageTypedDict - reasoning_details: NotRequired[List[Schema3TypedDict]] logprobs: NotRequired[Nullable[ChatMessageTokenLogprobsTypedDict]] @@ -39,13 +36,11 @@ class ChatResponseChoice(BaseModel): message: AssistantMessage - reasoning_details: Optional[List[Schema3]] = None - logprobs: OptionalNullable[ChatMessageTokenLogprobs] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["reasoning_details", "logprobs"] + optional_fields = ["logprobs"] nullable_fields = ["finish_reason", "logprobs"] null_default_fields = [] diff --git a/src/openrouter/components/chatstreamingmessagechunk.py b/src/openrouter/components/chatstreamingmessagechunk.py index 8852ee8..05aeb51 100644 --- a/src/openrouter/components/chatstreamingmessagechunk.py +++ b/src/openrouter/components/chatstreamingmessagechunk.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from ._schema3 import Schema3, Schema3TypedDict +from ._schema2 import Schema2, Schema2TypedDict from .chatstreamingmessagetoolcall import ( ChatStreamingMessageToolCall, ChatStreamingMessageToolCallTypedDict, @@ -27,7 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict): reasoning: NotRequired[Nullable[str]] refusal: NotRequired[Nullable[str]] tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]] - reasoning_details: NotRequired[List[Schema3TypedDict]] + reasoning_details: NotRequired[List[Schema2TypedDict]] class ChatStreamingMessageChunk(BaseModel): @@ -41,7 +41,7 @@ class ChatStreamingMessageChunk(BaseModel): tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None - reasoning_details: Optional[List[Schema3]] = None + reasoning_details: Optional[List[Schema2]] = None @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/openrouter/components/model.py b/src/openrouter/components/model.py index 16f1a88..7a14da5 100644 --- a/src/openrouter/components/model.py +++ b/src/openrouter/components/model.py @@ -50,6 +50,8 @@ class ModelTypedDict(TypedDict): r"""Hugging Face model identifier, if applicable""" description: NotRequired[str] r"""Description of the model""" + expiration_date: NotRequired[Nullable[str]] + r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.""" class Model(BaseModel): @@ -96,14 +98,18 @@ class Model(BaseModel): description: Optional[str] = None r"""Description of the model""" + expiration_date: OptionalNullable[str] = UNSET + r"""The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.""" + @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["hugging_face_id", "description"] + optional_fields = ["hugging_face_id", "description", "expiration_date"] nullable_fields = [ "hugging_face_id", "context_length", "per_request_limits", "default_parameters", + "expiration_date", ] null_default_fields = [] diff --git a/src/openrouter/components/outputmodality.py b/src/openrouter/components/outputmodality.py index 3dfd169..a127bd4 100644 --- a/src/openrouter/components/outputmodality.py +++ b/src/openrouter/components/outputmodality.py @@ -10,6 +10,7 @@ OutputModality = Union[ "text", "image", "embeddings", + "audio", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/publicendpoint.py b/src/openrouter/components/publicendpoint.py index 22a4645..dcb5e7c 100644 --- a/src/openrouter/components/publicendpoint.py +++ b/src/openrouter/components/publicendpoint.py @@ -28,6 +28,8 @@ class PricingTypedDict(TypedDict): r"""A value in string format that is a large number""" audio: NotRequired[str] r"""A value in string format that is a large number""" + audio_output: NotRequired[str] + r"""A value in string format that is a large number""" input_audio_cache: NotRequired[str] r"""A value in string format that is a large number""" web_search: NotRequired[str] @@ -63,6 +65,9 @@ class Pricing(BaseModel): audio: Optional[str] = None r"""A value in string format that is a large number""" + audio_output: Optional[str] = None + r"""A value in string format that is a large number""" + input_audio_cache: Optional[str] = None r"""A value in string format that is a large number""" @@ -101,6 +106,8 @@ class PublicEndpointTypedDict(TypedDict): r"""Information about a specific model endpoint""" name: str + model_id: str + r"""The unique identifier for the model (permaslug)""" model_name: str context_length: float pricing: PricingTypedDict @@ -123,6 +130,9 @@ class PublicEndpoint(BaseModel): name: str + model_id: str + r"""The unique identifier for the model (permaslug)""" + model_name: str context_length: float diff --git a/src/openrouter/components/publicpricing.py b/src/openrouter/components/publicpricing.py index b8b0e40..5bd726d 100644 --- a/src/openrouter/components/publicpricing.py +++ b/src/openrouter/components/publicpricing.py @@ -23,6 +23,8 @@ class PublicPricingTypedDict(TypedDict): r"""A value in string format that is a large number""" audio: NotRequired[str] r"""A value in string format that is a large number""" + audio_output: NotRequired[str] + r"""A value in string format that is a large number""" input_audio_cache: NotRequired[str] r"""A value in string format that is a large number""" web_search: NotRequired[str] @@ -60,6 +62,9 @@ class PublicPricing(BaseModel): audio: Optional[str] = None r"""A value in string format that is a large number""" + audio_output: Optional[str] = None + r"""A value in string format that is a large number""" + input_audio_cache: Optional[str] = None r"""A value in string format that is a large number""" diff --git a/src/openrouter/credits.py b/src/openrouter/credits.py index 241f22f..fc70b00 100644 --- a/src/openrouter/credits.py +++ b/src/openrouter/credits.py @@ -22,7 +22,7 @@ class Credits(BaseSDK): ) -> operations.GetCreditsResponse: r"""Get remaining credits - Get total credits purchased and used for the authenticated user + Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -119,7 +119,7 @@ class Credits(BaseSDK): ) -> operations.GetCreditsResponse: r"""Get remaining credits - Get total credits purchased and used for the authenticated user + Get total credits purchased and used for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py new file mode 100644 index 0000000..73c7370 --- /dev/null +++ b/src/openrouter/guardrails.py @@ -0,0 +1,3017 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from openrouter import components, errors, operations, utils +from openrouter._hooks import HookContext +from openrouter.types import OptionalNullable, UNSET +from openrouter.utils import get_security_from_env +from openrouter.utils.unmarshal_json_response import unmarshal_json_response +from typing import Any, List, Mapping, Optional + + +class Guardrails(BaseSDK): + r"""Guardrails endpoints""" + + def list( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailsResponse: + r"""List guardrails + + List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/guardrails", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrails", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.ListGuardrailsResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_async( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailsResponse: + r"""List guardrails + + List all guardrails for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrails", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.ListGuardrailsResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def create( + self, + *, + name: str, + description: OptionalNullable[str] = UNSET, + limit_usd: OptionalNullable[float] = UNSET, + reset_interval: OptionalNullable[ + operations.CreateGuardrailResetIntervalRequest + ] = UNSET, + allowed_providers: OptionalNullable[List[str]] = UNSET, + allowed_models: OptionalNullable[List[str]] = UNSET, + enforce_zdr: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateGuardrailResponse: + r"""Create a guardrail + + Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param name: Name for the new guardrail + :param description: Description of the guardrail + :param limit_usd: Spending limit in USD + :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) + :param allowed_providers: List of allowed provider IDs + :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) + :param enforce_zdr: Whether to enforce zero data retention + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateGuardrailRequest( + name=name, + description=description, + limit_usd=limit_usd, + reset_interval=reset_interval, + allowed_providers=allowed_providers, + allowed_models=allowed_models, + enforce_zdr=enforce_zdr, + ) + + req = self._build_request( + method="POST", + path="/guardrails", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", operations.CreateGuardrailRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(operations.CreateGuardrailResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def create_async( + self, + *, + name: str, + description: OptionalNullable[str] = UNSET, + limit_usd: OptionalNullable[float] = UNSET, + reset_interval: OptionalNullable[ + operations.CreateGuardrailResetIntervalRequest + ] = UNSET, + allowed_providers: OptionalNullable[List[str]] = UNSET, + allowed_models: OptionalNullable[List[str]] = UNSET, + enforce_zdr: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CreateGuardrailResponse: + r"""Create a guardrail + + Create a new guardrail for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param name: Name for the new guardrail + :param description: Description of the guardrail + :param limit_usd: Spending limit in USD + :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) + :param allowed_providers: List of allowed provider IDs + :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) + :param enforce_zdr: Whether to enforce zero data retention + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.CreateGuardrailRequest( + name=name, + description=description, + limit_usd=limit_usd, + reset_interval=reset_interval, + allowed_providers=allowed_providers, + allowed_models=allowed_models, + enforce_zdr=enforce_zdr, + ) + + req = self._build_request_async( + method="POST", + path="/guardrails", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "json", operations.CreateGuardrailRequest + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="createGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "201", "application/json"): + return unmarshal_json_response(operations.CreateGuardrailResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def get( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetGuardrailResponse: + r"""Get a guardrail + + Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to retrieve + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetGuardrailRequest( + id=id, + ) + + req = self._build_request( + method="GET", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.GetGuardrailResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def get_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetGuardrailResponse: + r"""Get a guardrail + + Get a single guardrail by ID. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to retrieve + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.GetGuardrailRequest( + id=id, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="getGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.GetGuardrailResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def update( + self, + *, + id: str, + name: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + limit_usd: OptionalNullable[float] = UNSET, + reset_interval: OptionalNullable[ + operations.UpdateGuardrailResetIntervalRequest + ] = UNSET, + allowed_providers: OptionalNullable[List[str]] = UNSET, + allowed_models: OptionalNullable[List[str]] = UNSET, + enforce_zdr: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdateGuardrailResponse: + r"""Update a guardrail + + Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to update + :param name: New name for the guardrail + :param description: New description for the guardrail + :param limit_usd: New spending limit in USD + :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) + :param allowed_providers: New list of allowed provider IDs + :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) + :param enforce_zdr: Whether to enforce zero data retention + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.UpdateGuardrailRequest( + id=id, + request_body=operations.UpdateGuardrailRequestBody( + name=name, + description=description, + limit_usd=limit_usd, + reset_interval=reset_interval, + allowed_providers=allowed_providers, + allowed_models=allowed_models, + enforce_zdr=enforce_zdr, + ), + ) + + req = self._build_request( + method="PATCH", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.UpdateGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="updateGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.UpdateGuardrailResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def update_async( + self, + *, + id: str, + name: Optional[str] = None, + description: OptionalNullable[str] = UNSET, + limit_usd: OptionalNullable[float] = UNSET, + reset_interval: OptionalNullable[ + operations.UpdateGuardrailResetIntervalRequest + ] = UNSET, + allowed_providers: OptionalNullable[List[str]] = UNSET, + allowed_models: OptionalNullable[List[str]] = UNSET, + enforce_zdr: OptionalNullable[bool] = UNSET, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.UpdateGuardrailResponse: + r"""Update a guardrail + + Update an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to update + :param name: New name for the guardrail + :param description: New description for the guardrail + :param limit_usd: New spending limit in USD + :param reset_interval: Interval at which the limit resets (daily, weekly, monthly) + :param allowed_providers: New list of allowed provider IDs + :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) + :param enforce_zdr: Whether to enforce zero data retention + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.UpdateGuardrailRequest( + id=id, + request_body=operations.UpdateGuardrailRequestBody( + name=name, + description=description, + limit_usd=limit_usd, + reset_interval=reset_interval, + allowed_providers=allowed_providers, + allowed_models=allowed_models, + enforce_zdr=enforce_zdr, + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.UpdateGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="updateGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.UpdateGuardrailResponse, http_res) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def delete( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeleteGuardrailResponse: + r"""Delete a guardrail + + Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to delete + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteGuardrailRequest( + id=id, + ) + + req = self._build_request( + method="DELETE", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.DeleteGuardrailResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def delete_async( + self, + *, + id: str, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.DeleteGuardrailResponse: + r"""Delete a guardrail + + Delete an existing guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail to delete + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.DeleteGuardrailRequest( + id=id, + ) + + req = self._build_request_async( + method="DELETE", + path="/guardrails/{id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="deleteGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response(operations.DeleteGuardrailResponse, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def list_key_assignments( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListKeyAssignmentsResponse: + r"""List all key assignments + + List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListKeyAssignmentsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/guardrails/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listKeyAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListKeyAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_key_assignments_async( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListKeyAssignmentsResponse: + r"""List all key assignments + + List all API key guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListKeyAssignmentsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listKeyAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListKeyAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def list_member_assignments( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListMemberAssignmentsResponse: + r"""List all member assignments + + List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListMemberAssignmentsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/guardrails/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listMemberAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListMemberAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_member_assignments_async( + self, + *, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListMemberAssignmentsResponse: + r"""List all member assignments + + List all organization member guardrail assignments for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListMemberAssignmentsRequest( + offset=offset, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listMemberAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListMemberAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def list_guardrail_key_assignments( + self, + *, + id: str, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailKeyAssignmentsResponse: + r"""List key assignments for a guardrail + + List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailKeyAssignmentsRequest( + id=id, + offset=offset, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/guardrails/{id}/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrailKeyAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListGuardrailKeyAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_guardrail_key_assignments_async( + self, + *, + id: str, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailKeyAssignmentsResponse: + r"""List key assignments for a guardrail + + List all API key assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailKeyAssignmentsRequest( + id=id, + offset=offset, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails/{id}/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrailKeyAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListGuardrailKeyAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def bulk_assign_keys( + self, + *, + id: str, + key_hashes: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkAssignKeysToGuardrailResponse: + r"""Bulk assign keys to a guardrail + + Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param key_hashes: Array of API key hashes to assign to the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkAssignKeysToGuardrailRequest( + id=id, + request_body=operations.BulkAssignKeysToGuardrailRequestBody( + key_hashes=key_hashes, + ), + ) + + req = self._build_request( + method="POST", + path="/guardrails/{id}/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkAssignKeysToGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkAssignKeysToGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkAssignKeysToGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def bulk_assign_keys_async( + self, + *, + id: str, + key_hashes: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkAssignKeysToGuardrailResponse: + r"""Bulk assign keys to a guardrail + + Assign multiple API keys to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param key_hashes: Array of API key hashes to assign to the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkAssignKeysToGuardrailRequest( + id=id, + request_body=operations.BulkAssignKeysToGuardrailRequestBody( + key_hashes=key_hashes, + ), + ) + + req = self._build_request_async( + method="POST", + path="/guardrails/{id}/assignments/keys", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkAssignKeysToGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkAssignKeysToGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkAssignKeysToGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def list_guardrail_member_assignments( + self, + *, + id: str, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailMemberAssignmentsResponse: + r"""List member assignments for a guardrail + + List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailMemberAssignmentsRequest( + id=id, + offset=offset, + limit=limit, + ) + + req = self._build_request( + method="GET", + path="/guardrails/{id}/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrailMemberAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListGuardrailMemberAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def list_guardrail_member_assignments_async( + self, + *, + id: str, + offset: Optional[str] = None, + limit: Optional[str] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.ListGuardrailMemberAssignmentsResponse: + r"""List member assignments for a guardrail + + List all organization member assignments for a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param offset: Number of records to skip for pagination + :param limit: Maximum number of records to return (max 100) + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.ListGuardrailMemberAssignmentsRequest( + id=id, + offset=offset, + limit=limit, + ) + + req = self._build_request_async( + method="GET", + path="/guardrails/{id}/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="listGuardrailMemberAssignments", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.ListGuardrailMemberAssignmentsResponse, http_res + ) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def bulk_assign_members( + self, + *, + id: str, + member_user_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkAssignMembersToGuardrailResponse: + r"""Bulk assign members to a guardrail + + Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param member_user_ids: Array of member user IDs to assign to the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkAssignMembersToGuardrailRequest( + id=id, + request_body=operations.BulkAssignMembersToGuardrailRequestBody( + member_user_ids=member_user_ids, + ), + ) + + req = self._build_request( + method="POST", + path="/guardrails/{id}/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkAssignMembersToGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkAssignMembersToGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkAssignMembersToGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def bulk_assign_members_async( + self, + *, + id: str, + member_user_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkAssignMembersToGuardrailResponse: + r"""Bulk assign members to a guardrail + + Assign multiple organization members to a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param member_user_ids: Array of member user IDs to assign to the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkAssignMembersToGuardrailRequest( + id=id, + request_body=operations.BulkAssignMembersToGuardrailRequestBody( + member_user_ids=member_user_ids, + ), + ) + + req = self._build_request_async( + method="POST", + path="/guardrails/{id}/assignments/members", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkAssignMembersToGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkAssignMembersToGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkAssignMembersToGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def bulk_unassign_keys( + self, + *, + id: str, + key_hashes: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkUnassignKeysFromGuardrailResponse: + r"""Bulk unassign keys from a guardrail + + Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param key_hashes: Array of API key hashes to unassign from the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkUnassignKeysFromGuardrailRequest( + id=id, + request_body=operations.BulkUnassignKeysFromGuardrailRequestBody( + key_hashes=key_hashes, + ), + ) + + req = self._build_request( + method="POST", + path="/guardrails/{id}/assignments/keys/remove", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkUnassignKeysFromGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkUnassignKeysFromGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkUnassignKeysFromGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def bulk_unassign_keys_async( + self, + *, + id: str, + key_hashes: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkUnassignKeysFromGuardrailResponse: + r"""Bulk unassign keys from a guardrail + + Unassign multiple API keys from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param key_hashes: Array of API key hashes to unassign from the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkUnassignKeysFromGuardrailRequest( + id=id, + request_body=operations.BulkUnassignKeysFromGuardrailRequestBody( + key_hashes=key_hashes, + ), + ) + + req = self._build_request_async( + method="POST", + path="/guardrails/{id}/assignments/keys/remove", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkUnassignKeysFromGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkUnassignKeysFromGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkUnassignKeysFromGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + def bulk_unassign_members( + self, + *, + id: str, + member_user_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkUnassignMembersFromGuardrailResponse: + r"""Bulk unassign members from a guardrail + + Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param member_user_ids: Array of member user IDs to unassign from the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkUnassignMembersFromGuardrailRequest( + id=id, + request_body=operations.BulkUnassignMembersFromGuardrailRequestBody( + member_user_ids=member_user_ids, + ), + ) + + req = self._build_request( + method="POST", + path="/guardrails/{id}/assignments/members/remove", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkUnassignMembersFromGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkUnassignMembersFromGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkUnassignMembersFromGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) + + async def bulk_unassign_members_async( + self, + *, + id: str, + member_user_ids: List[str], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.BulkUnassignMembersFromGuardrailResponse: + r"""Bulk unassign members from a guardrail + + Unassign multiple organization members from a specific guardrail. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required. + + :param id: The unique identifier of the guardrail + :param member_user_ids: Array of member user IDs to unassign from the guardrail + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = operations.BulkUnassignMembersFromGuardrailRequest( + id=id, + request_body=operations.BulkUnassignMembersFromGuardrailRequestBody( + member_user_ids=member_user_ids, + ), + ) + + req = self._build_request_async( + method="POST", + path="/guardrails/{id}/assignments/members/remove", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + operations.BulkUnassignMembersFromGuardrailRequestBody, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="bulkUnassignMembersFromGuardrail", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, components.Security + ), + ), + request=req, + error_status_codes=["400", "401", "404", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return unmarshal_json_response( + operations.BulkUnassignMembersFromGuardrailResponse, http_res + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = unmarshal_json_response( + errors.BadRequestResponseErrorData, http_res + ) + raise errors.BadRequestResponseError(response_data, http_res) + if utils.match_response(http_res, "401", "application/json"): + response_data = unmarshal_json_response( + errors.UnauthorizedResponseErrorData, http_res + ) + raise errors.UnauthorizedResponseError(response_data, http_res) + if utils.match_response(http_res, "404", "application/json"): + response_data = unmarshal_json_response( + errors.NotFoundResponseErrorData, http_res + ) + raise errors.NotFoundResponseError(response_data, http_res) + if utils.match_response(http_res, "500", "application/json"): + response_data = unmarshal_json_response( + errors.InternalServerResponseErrorData, http_res + ) + raise errors.InternalServerResponseError(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.OpenRouterDefaultError( + "API error occurred", http_res, http_res_text + ) + + raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/models_.py b/src/openrouter/models_.py index 6b9e6e7..a3d8d13 100644 --- a/src/openrouter/models_.py +++ b/src/openrouter/models_.py @@ -185,7 +185,7 @@ class Models(BaseSDK): def list( self, *, - category: Optional[str] = None, + category: Optional[operations.Category] = None, supported_parameters: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -194,7 +194,7 @@ class Models(BaseSDK): ) -> components.ModelsListResponse: r"""List all models and their properties - :param category: + :param category: Filter models by use case category :param supported_parameters: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -285,7 +285,7 @@ class Models(BaseSDK): async def list_async( self, *, - category: Optional[str] = None, + category: Optional[operations.Category] = None, supported_parameters: Optional[str] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, @@ -294,7 +294,7 @@ class Models(BaseSDK): ) -> components.ModelsListResponse: r"""List all models and their properties - :param category: + :param category: Filter models by use case category :param supported_parameters: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/openrouter/operations/__init__.py b/src/openrouter/operations/__init__.py index be7e440..6620d39 100644 --- a/src/openrouter/operations/__init__.py +++ b/src/openrouter/operations/__init__.py @@ -6,6 +6,38 @@ import builtins import sys if TYPE_CHECKING: + from .bulkassignkeystoguardrail import ( + BulkAssignKeysToGuardrailRequest, + BulkAssignKeysToGuardrailRequestBody, + BulkAssignKeysToGuardrailRequestBodyTypedDict, + BulkAssignKeysToGuardrailRequestTypedDict, + BulkAssignKeysToGuardrailResponse, + BulkAssignKeysToGuardrailResponseTypedDict, + ) + from .bulkassignmemberstoguardrail import ( + BulkAssignMembersToGuardrailRequest, + BulkAssignMembersToGuardrailRequestBody, + BulkAssignMembersToGuardrailRequestBodyTypedDict, + BulkAssignMembersToGuardrailRequestTypedDict, + BulkAssignMembersToGuardrailResponse, + BulkAssignMembersToGuardrailResponseTypedDict, + ) + from .bulkunassignkeysfromguardrail import ( + BulkUnassignKeysFromGuardrailRequest, + BulkUnassignKeysFromGuardrailRequestBody, + BulkUnassignKeysFromGuardrailRequestBodyTypedDict, + BulkUnassignKeysFromGuardrailRequestTypedDict, + BulkUnassignKeysFromGuardrailResponse, + BulkUnassignKeysFromGuardrailResponseTypedDict, + ) + from .bulkunassignmembersfromguardrail import ( + BulkUnassignMembersFromGuardrailRequest, + BulkUnassignMembersFromGuardrailRequestBody, + BulkUnassignMembersFromGuardrailRequestBodyTypedDict, + BulkUnassignMembersFromGuardrailRequestTypedDict, + BulkUnassignMembersFromGuardrailResponse, + BulkUnassignMembersFromGuardrailResponseTypedDict, + ) from .createauthkeyscode import ( CreateAuthKeysCodeCodeChallengeMethod, CreateAuthKeysCodeData, @@ -62,6 +94,16 @@ if TYPE_CHECKING: Usage, UsageTypedDict, ) + from .createguardrail import ( + CreateGuardrailData, + CreateGuardrailDataTypedDict, + CreateGuardrailRequest, + CreateGuardrailRequestTypedDict, + CreateGuardrailResetIntervalRequest, + CreateGuardrailResetIntervalResponse, + CreateGuardrailResponse, + CreateGuardrailResponseTypedDict, + ) from .createkeys import ( CreateKeysData, CreateKeysDataTypedDict, @@ -77,6 +119,12 @@ if TYPE_CHECKING: CreateResponsesResponseBodyTypedDict, CreateResponsesResponseTypedDict, ) + from .deleteguardrail import ( + DeleteGuardrailRequest, + DeleteGuardrailRequestTypedDict, + DeleteGuardrailResponse, + DeleteGuardrailResponseTypedDict, + ) from .deletekeys import ( DeleteKeysRequest, DeleteKeysRequestTypedDict, @@ -113,6 +161,15 @@ if TYPE_CHECKING: GetGenerationResponse, GetGenerationResponseTypedDict, ) + from .getguardrail import ( + GetGuardrailData, + GetGuardrailDataTypedDict, + GetGuardrailRequest, + GetGuardrailRequestTypedDict, + GetGuardrailResetInterval, + GetGuardrailResponse, + GetGuardrailResponseTypedDict, + ) from .getkey import ( GetKeyData, GetKeyDataTypedDict, @@ -121,18 +178,7 @@ if TYPE_CHECKING: GetKeyResponse, GetKeyResponseTypedDict, ) - from .getmodels import GetModelsRequest, GetModelsRequestTypedDict - from .getparameters import ( - GetParametersData, - GetParametersDataTypedDict, - GetParametersRequest, - GetParametersRequestTypedDict, - GetParametersResponse, - GetParametersResponseTypedDict, - GetParametersSecurity, - GetParametersSecurityTypedDict, - SupportedParameter, - ) + from .getmodels import Category, GetModelsRequest, GetModelsRequestTypedDict from .getuseractivity import ( GetUserActivityRequest, GetUserActivityRequestTypedDict, @@ -157,6 +203,47 @@ if TYPE_CHECKING: ListEndpointsZdrResponse, ListEndpointsZdrResponseTypedDict, ) + from .listguardrailkeyassignments import ( + ListGuardrailKeyAssignmentsData, + ListGuardrailKeyAssignmentsDataTypedDict, + ListGuardrailKeyAssignmentsRequest, + ListGuardrailKeyAssignmentsRequestTypedDict, + ListGuardrailKeyAssignmentsResponse, + ListGuardrailKeyAssignmentsResponseTypedDict, + ) + from .listguardrailmemberassignments import ( + ListGuardrailMemberAssignmentsData, + ListGuardrailMemberAssignmentsDataTypedDict, + ListGuardrailMemberAssignmentsRequest, + ListGuardrailMemberAssignmentsRequestTypedDict, + ListGuardrailMemberAssignmentsResponse, + ListGuardrailMemberAssignmentsResponseTypedDict, + ) + from .listguardrails import ( + ListGuardrailsData, + ListGuardrailsDataTypedDict, + ListGuardrailsRequest, + ListGuardrailsRequestTypedDict, + ListGuardrailsResetInterval, + ListGuardrailsResponse, + ListGuardrailsResponseTypedDict, + ) + from .listkeyassignments import ( + ListKeyAssignmentsData, + ListKeyAssignmentsDataTypedDict, + ListKeyAssignmentsRequest, + ListKeyAssignmentsRequestTypedDict, + ListKeyAssignmentsResponse, + ListKeyAssignmentsResponseTypedDict, + ) + from .listmemberassignments import ( + ListMemberAssignmentsData, + ListMemberAssignmentsDataTypedDict, + ListMemberAssignmentsRequest, + ListMemberAssignmentsRequestTypedDict, + ListMemberAssignmentsResponse, + ListMemberAssignmentsResponseTypedDict, + ) from .listmodelsuser import ListModelsUserSecurity, ListModelsUserSecurityTypedDict from .listproviders import ( ListProvidersData, @@ -168,6 +255,18 @@ if TYPE_CHECKING: SendChatCompletionRequestResponse, SendChatCompletionRequestResponseTypedDict, ) + from .updateguardrail import ( + UpdateGuardrailData, + UpdateGuardrailDataTypedDict, + UpdateGuardrailRequest, + UpdateGuardrailRequestBody, + UpdateGuardrailRequestBodyTypedDict, + UpdateGuardrailRequestTypedDict, + UpdateGuardrailResetIntervalRequest, + UpdateGuardrailResetIntervalResponse, + UpdateGuardrailResponse, + UpdateGuardrailResponseTypedDict, + ) from .updatekeys import ( UpdateKeysData, UpdateKeysDataTypedDict, @@ -182,8 +281,33 @@ if TYPE_CHECKING: __all__ = [ "APIType", + "BulkAssignKeysToGuardrailRequest", + "BulkAssignKeysToGuardrailRequestBody", + "BulkAssignKeysToGuardrailRequestBodyTypedDict", + "BulkAssignKeysToGuardrailRequestTypedDict", + "BulkAssignKeysToGuardrailResponse", + "BulkAssignKeysToGuardrailResponseTypedDict", + "BulkAssignMembersToGuardrailRequest", + "BulkAssignMembersToGuardrailRequestBody", + "BulkAssignMembersToGuardrailRequestBodyTypedDict", + "BulkAssignMembersToGuardrailRequestTypedDict", + "BulkAssignMembersToGuardrailResponse", + "BulkAssignMembersToGuardrailResponseTypedDict", + "BulkUnassignKeysFromGuardrailRequest", + "BulkUnassignKeysFromGuardrailRequestBody", + "BulkUnassignKeysFromGuardrailRequestBodyTypedDict", + "BulkUnassignKeysFromGuardrailRequestTypedDict", + "BulkUnassignKeysFromGuardrailResponse", + "BulkUnassignKeysFromGuardrailResponseTypedDict", + "BulkUnassignMembersFromGuardrailRequest", + "BulkUnassignMembersFromGuardrailRequestBody", + "BulkUnassignMembersFromGuardrailRequestBodyTypedDict", + "BulkUnassignMembersFromGuardrailRequestTypedDict", + "BulkUnassignMembersFromGuardrailResponse", + "BulkUnassignMembersFromGuardrailResponseTypedDict", "CallData", "CallDataTypedDict", + "Category", "Content", "ContentImageURL", "ContentImageURLTypedDict", @@ -211,6 +335,14 @@ __all__ = [ "CreateEmbeddingsResponseBody", "CreateEmbeddingsResponseBodyTypedDict", "CreateEmbeddingsResponseTypedDict", + "CreateGuardrailData", + "CreateGuardrailDataTypedDict", + "CreateGuardrailRequest", + "CreateGuardrailRequestTypedDict", + "CreateGuardrailResetIntervalRequest", + "CreateGuardrailResetIntervalResponse", + "CreateGuardrailResponse", + "CreateGuardrailResponseTypedDict", "CreateKeysData", "CreateKeysDataTypedDict", "CreateKeysLimitReset", @@ -222,6 +354,10 @@ __all__ = [ "CreateResponsesResponseBody", "CreateResponsesResponseBodyTypedDict", "CreateResponsesResponseTypedDict", + "DeleteGuardrailRequest", + "DeleteGuardrailRequestTypedDict", + "DeleteGuardrailResponse", + "DeleteGuardrailResponseTypedDict", "DeleteKeysRequest", "DeleteKeysRequestTypedDict", "DeleteKeysResponse", @@ -248,6 +384,13 @@ __all__ = [ "GetGenerationRequestTypedDict", "GetGenerationResponse", "GetGenerationResponseTypedDict", + "GetGuardrailData", + "GetGuardrailDataTypedDict", + "GetGuardrailRequest", + "GetGuardrailRequestTypedDict", + "GetGuardrailResetInterval", + "GetGuardrailResponse", + "GetGuardrailResponseTypedDict", "GetKeyData", "GetKeyDataTypedDict", "GetKeyRequest", @@ -256,14 +399,6 @@ __all__ = [ "GetKeyResponseTypedDict", "GetModelsRequest", "GetModelsRequestTypedDict", - "GetParametersData", - "GetParametersDataTypedDict", - "GetParametersRequest", - "GetParametersRequestTypedDict", - "GetParametersResponse", - "GetParametersResponseTypedDict", - "GetParametersSecurity", - "GetParametersSecurityTypedDict", "GetUserActivityRequest", "GetUserActivityRequestTypedDict", "GetUserActivityResponse", @@ -282,6 +417,37 @@ __all__ = [ "ListEndpointsResponseTypedDict", "ListEndpointsZdrResponse", "ListEndpointsZdrResponseTypedDict", + "ListGuardrailKeyAssignmentsData", + "ListGuardrailKeyAssignmentsDataTypedDict", + "ListGuardrailKeyAssignmentsRequest", + "ListGuardrailKeyAssignmentsRequestTypedDict", + "ListGuardrailKeyAssignmentsResponse", + "ListGuardrailKeyAssignmentsResponseTypedDict", + "ListGuardrailMemberAssignmentsData", + "ListGuardrailMemberAssignmentsDataTypedDict", + "ListGuardrailMemberAssignmentsRequest", + "ListGuardrailMemberAssignmentsRequestTypedDict", + "ListGuardrailMemberAssignmentsResponse", + "ListGuardrailMemberAssignmentsResponseTypedDict", + "ListGuardrailsData", + "ListGuardrailsDataTypedDict", + "ListGuardrailsRequest", + "ListGuardrailsRequestTypedDict", + "ListGuardrailsResetInterval", + "ListGuardrailsResponse", + "ListGuardrailsResponseTypedDict", + "ListKeyAssignmentsData", + "ListKeyAssignmentsDataTypedDict", + "ListKeyAssignmentsRequest", + "ListKeyAssignmentsRequestTypedDict", + "ListKeyAssignmentsResponse", + "ListKeyAssignmentsResponseTypedDict", + "ListMemberAssignmentsData", + "ListMemberAssignmentsDataTypedDict", + "ListMemberAssignmentsRequest", + "ListMemberAssignmentsRequestTypedDict", + "ListMemberAssignmentsResponse", + "ListMemberAssignmentsResponseTypedDict", "ListModelsUserSecurity", "ListModelsUserSecurityTypedDict", "ListProvidersData", @@ -300,11 +466,20 @@ __all__ = [ "RateLimitTypedDict", "SendChatCompletionRequestResponse", "SendChatCompletionRequestResponseTypedDict", - "SupportedParameter", "TransferIntent", "TransferIntentTypedDict", "TypeImageURL", "TypeText", + "UpdateGuardrailData", + "UpdateGuardrailDataTypedDict", + "UpdateGuardrailRequest", + "UpdateGuardrailRequestBody", + "UpdateGuardrailRequestBodyTypedDict", + "UpdateGuardrailRequestTypedDict", + "UpdateGuardrailResetIntervalRequest", + "UpdateGuardrailResetIntervalResponse", + "UpdateGuardrailResponse", + "UpdateGuardrailResponseTypedDict", "UpdateKeysData", "UpdateKeysDataTypedDict", "UpdateKeysLimitReset", @@ -321,6 +496,30 @@ __all__ = [ ] _dynamic_imports: dict[str, str] = { + "BulkAssignKeysToGuardrailRequest": ".bulkassignkeystoguardrail", + "BulkAssignKeysToGuardrailRequestBody": ".bulkassignkeystoguardrail", + "BulkAssignKeysToGuardrailRequestBodyTypedDict": ".bulkassignkeystoguardrail", + "BulkAssignKeysToGuardrailRequestTypedDict": ".bulkassignkeystoguardrail", + "BulkAssignKeysToGuardrailResponse": ".bulkassignkeystoguardrail", + "BulkAssignKeysToGuardrailResponseTypedDict": ".bulkassignkeystoguardrail", + "BulkAssignMembersToGuardrailRequest": ".bulkassignmemberstoguardrail", + "BulkAssignMembersToGuardrailRequestBody": ".bulkassignmemberstoguardrail", + "BulkAssignMembersToGuardrailRequestBodyTypedDict": ".bulkassignmemberstoguardrail", + "BulkAssignMembersToGuardrailRequestTypedDict": ".bulkassignmemberstoguardrail", + "BulkAssignMembersToGuardrailResponse": ".bulkassignmemberstoguardrail", + "BulkAssignMembersToGuardrailResponseTypedDict": ".bulkassignmemberstoguardrail", + "BulkUnassignKeysFromGuardrailRequest": ".bulkunassignkeysfromguardrail", + "BulkUnassignKeysFromGuardrailRequestBody": ".bulkunassignkeysfromguardrail", + "BulkUnassignKeysFromGuardrailRequestBodyTypedDict": ".bulkunassignkeysfromguardrail", + "BulkUnassignKeysFromGuardrailRequestTypedDict": ".bulkunassignkeysfromguardrail", + "BulkUnassignKeysFromGuardrailResponse": ".bulkunassignkeysfromguardrail", + "BulkUnassignKeysFromGuardrailResponseTypedDict": ".bulkunassignkeysfromguardrail", + "BulkUnassignMembersFromGuardrailRequest": ".bulkunassignmembersfromguardrail", + "BulkUnassignMembersFromGuardrailRequestBody": ".bulkunassignmembersfromguardrail", + "BulkUnassignMembersFromGuardrailRequestBodyTypedDict": ".bulkunassignmembersfromguardrail", + "BulkUnassignMembersFromGuardrailRequestTypedDict": ".bulkunassignmembersfromguardrail", + "BulkUnassignMembersFromGuardrailResponse": ".bulkunassignmembersfromguardrail", + "BulkUnassignMembersFromGuardrailResponseTypedDict": ".bulkunassignmembersfromguardrail", "CreateAuthKeysCodeCodeChallengeMethod": ".createauthkeyscode", "CreateAuthKeysCodeData": ".createauthkeyscode", "CreateAuthKeysCodeDataTypedDict": ".createauthkeyscode", @@ -371,6 +570,14 @@ _dynamic_imports: dict[str, str] = { "TypeText": ".createembeddings", "Usage": ".createembeddings", "UsageTypedDict": ".createembeddings", + "CreateGuardrailData": ".createguardrail", + "CreateGuardrailDataTypedDict": ".createguardrail", + "CreateGuardrailRequest": ".createguardrail", + "CreateGuardrailRequestTypedDict": ".createguardrail", + "CreateGuardrailResetIntervalRequest": ".createguardrail", + "CreateGuardrailResetIntervalResponse": ".createguardrail", + "CreateGuardrailResponse": ".createguardrail", + "CreateGuardrailResponseTypedDict": ".createguardrail", "CreateKeysData": ".createkeys", "CreateKeysDataTypedDict": ".createkeys", "CreateKeysLimitReset": ".createkeys", @@ -382,6 +589,10 @@ _dynamic_imports: dict[str, str] = { "CreateResponsesResponseBody": ".createresponses", "CreateResponsesResponseBodyTypedDict": ".createresponses", "CreateResponsesResponseTypedDict": ".createresponses", + "DeleteGuardrailRequest": ".deleteguardrail", + "DeleteGuardrailRequestTypedDict": ".deleteguardrail", + "DeleteGuardrailResponse": ".deleteguardrail", + "DeleteGuardrailResponseTypedDict": ".deleteguardrail", "DeleteKeysRequest": ".deletekeys", "DeleteKeysRequestTypedDict": ".deletekeys", "DeleteKeysResponse": ".deletekeys", @@ -408,23 +619,22 @@ _dynamic_imports: dict[str, str] = { "GetGenerationRequestTypedDict": ".getgeneration", "GetGenerationResponse": ".getgeneration", "GetGenerationResponseTypedDict": ".getgeneration", + "GetGuardrailData": ".getguardrail", + "GetGuardrailDataTypedDict": ".getguardrail", + "GetGuardrailRequest": ".getguardrail", + "GetGuardrailRequestTypedDict": ".getguardrail", + "GetGuardrailResetInterval": ".getguardrail", + "GetGuardrailResponse": ".getguardrail", + "GetGuardrailResponseTypedDict": ".getguardrail", "GetKeyData": ".getkey", "GetKeyDataTypedDict": ".getkey", "GetKeyRequest": ".getkey", "GetKeyRequestTypedDict": ".getkey", "GetKeyResponse": ".getkey", "GetKeyResponseTypedDict": ".getkey", + "Category": ".getmodels", "GetModelsRequest": ".getmodels", "GetModelsRequestTypedDict": ".getmodels", - "GetParametersData": ".getparameters", - "GetParametersDataTypedDict": ".getparameters", - "GetParametersRequest": ".getparameters", - "GetParametersRequestTypedDict": ".getparameters", - "GetParametersResponse": ".getparameters", - "GetParametersResponseTypedDict": ".getparameters", - "GetParametersSecurity": ".getparameters", - "GetParametersSecurityTypedDict": ".getparameters", - "SupportedParameter": ".getparameters", "GetUserActivityRequest": ".getuseractivity", "GetUserActivityRequestTypedDict": ".getuseractivity", "GetUserActivityResponse": ".getuseractivity", @@ -441,6 +651,37 @@ _dynamic_imports: dict[str, str] = { "ListEndpointsResponseTypedDict": ".listendpoints", "ListEndpointsZdrResponse": ".listendpointszdr", "ListEndpointsZdrResponseTypedDict": ".listendpointszdr", + "ListGuardrailKeyAssignmentsData": ".listguardrailkeyassignments", + "ListGuardrailKeyAssignmentsDataTypedDict": ".listguardrailkeyassignments", + "ListGuardrailKeyAssignmentsRequest": ".listguardrailkeyassignments", + "ListGuardrailKeyAssignmentsRequestTypedDict": ".listguardrailkeyassignments", + "ListGuardrailKeyAssignmentsResponse": ".listguardrailkeyassignments", + "ListGuardrailKeyAssignmentsResponseTypedDict": ".listguardrailkeyassignments", + "ListGuardrailMemberAssignmentsData": ".listguardrailmemberassignments", + "ListGuardrailMemberAssignmentsDataTypedDict": ".listguardrailmemberassignments", + "ListGuardrailMemberAssignmentsRequest": ".listguardrailmemberassignments", + "ListGuardrailMemberAssignmentsRequestTypedDict": ".listguardrailmemberassignments", + "ListGuardrailMemberAssignmentsResponse": ".listguardrailmemberassignments", + "ListGuardrailMemberAssignmentsResponseTypedDict": ".listguardrailmemberassignments", + "ListGuardrailsData": ".listguardrails", + "ListGuardrailsDataTypedDict": ".listguardrails", + "ListGuardrailsRequest": ".listguardrails", + "ListGuardrailsRequestTypedDict": ".listguardrails", + "ListGuardrailsResetInterval": ".listguardrails", + "ListGuardrailsResponse": ".listguardrails", + "ListGuardrailsResponseTypedDict": ".listguardrails", + "ListKeyAssignmentsData": ".listkeyassignments", + "ListKeyAssignmentsDataTypedDict": ".listkeyassignments", + "ListKeyAssignmentsRequest": ".listkeyassignments", + "ListKeyAssignmentsRequestTypedDict": ".listkeyassignments", + "ListKeyAssignmentsResponse": ".listkeyassignments", + "ListKeyAssignmentsResponseTypedDict": ".listkeyassignments", + "ListMemberAssignmentsData": ".listmemberassignments", + "ListMemberAssignmentsDataTypedDict": ".listmemberassignments", + "ListMemberAssignmentsRequest": ".listmemberassignments", + "ListMemberAssignmentsRequestTypedDict": ".listmemberassignments", + "ListMemberAssignmentsResponse": ".listmemberassignments", + "ListMemberAssignmentsResponseTypedDict": ".listmemberassignments", "ListModelsUserSecurity": ".listmodelsuser", "ListModelsUserSecurityTypedDict": ".listmodelsuser", "ListProvidersData": ".listproviders", @@ -449,6 +690,16 @@ _dynamic_imports: dict[str, str] = { "ListProvidersResponseTypedDict": ".listproviders", "SendChatCompletionRequestResponse": ".sendchatcompletionrequest", "SendChatCompletionRequestResponseTypedDict": ".sendchatcompletionrequest", + "UpdateGuardrailData": ".updateguardrail", + "UpdateGuardrailDataTypedDict": ".updateguardrail", + "UpdateGuardrailRequest": ".updateguardrail", + "UpdateGuardrailRequestBody": ".updateguardrail", + "UpdateGuardrailRequestBodyTypedDict": ".updateguardrail", + "UpdateGuardrailRequestTypedDict": ".updateguardrail", + "UpdateGuardrailResetIntervalRequest": ".updateguardrail", + "UpdateGuardrailResetIntervalResponse": ".updateguardrail", + "UpdateGuardrailResponse": ".updateguardrail", + "UpdateGuardrailResponseTypedDict": ".updateguardrail", "UpdateKeysData": ".updatekeys", "UpdateKeysDataTypedDict": ".updatekeys", "UpdateKeysLimitReset": ".updatekeys", diff --git a/src/openrouter/operations/bulkassignkeystoguardrail.py b/src/openrouter/operations/bulkassignkeystoguardrail.py new file mode 100644 index 0000000..b899bfa --- /dev/null +++ b/src/openrouter/operations/bulkassignkeystoguardrail.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import List +from typing_extensions import Annotated, TypedDict + + +class BulkAssignKeysToGuardrailRequestBodyTypedDict(TypedDict): + key_hashes: List[str] + r"""Array of API key hashes to assign to the guardrail""" + + +class BulkAssignKeysToGuardrailRequestBody(BaseModel): + key_hashes: List[str] + r"""Array of API key hashes to assign to the guardrail""" + + +class BulkAssignKeysToGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + request_body: BulkAssignKeysToGuardrailRequestBodyTypedDict + + +class BulkAssignKeysToGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + request_body: Annotated[ + BulkAssignKeysToGuardrailRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +class BulkAssignKeysToGuardrailResponseTypedDict(TypedDict): + r"""Assignment result""" + + assigned_count: float + r"""Number of keys successfully assigned""" + + +class BulkAssignKeysToGuardrailResponse(BaseModel): + r"""Assignment result""" + + assigned_count: float + r"""Number of keys successfully assigned""" diff --git a/src/openrouter/operations/bulkassignmemberstoguardrail.py b/src/openrouter/operations/bulkassignmemberstoguardrail.py new file mode 100644 index 0000000..1342726 --- /dev/null +++ b/src/openrouter/operations/bulkassignmemberstoguardrail.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import List +from typing_extensions import Annotated, TypedDict + + +class BulkAssignMembersToGuardrailRequestBodyTypedDict(TypedDict): + member_user_ids: List[str] + r"""Array of member user IDs to assign to the guardrail""" + + +class BulkAssignMembersToGuardrailRequestBody(BaseModel): + member_user_ids: List[str] + r"""Array of member user IDs to assign to the guardrail""" + + +class BulkAssignMembersToGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + request_body: BulkAssignMembersToGuardrailRequestBodyTypedDict + + +class BulkAssignMembersToGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + request_body: Annotated[ + BulkAssignMembersToGuardrailRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +class BulkAssignMembersToGuardrailResponseTypedDict(TypedDict): + r"""Assignment result""" + + assigned_count: float + r"""Number of members successfully assigned""" + + +class BulkAssignMembersToGuardrailResponse(BaseModel): + r"""Assignment result""" + + assigned_count: float + r"""Number of members successfully assigned""" diff --git a/src/openrouter/operations/bulkunassignkeysfromguardrail.py b/src/openrouter/operations/bulkunassignkeysfromguardrail.py new file mode 100644 index 0000000..5d873be --- /dev/null +++ b/src/openrouter/operations/bulkunassignkeysfromguardrail.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import List +from typing_extensions import Annotated, TypedDict + + +class BulkUnassignKeysFromGuardrailRequestBodyTypedDict(TypedDict): + key_hashes: List[str] + r"""Array of API key hashes to unassign from the guardrail""" + + +class BulkUnassignKeysFromGuardrailRequestBody(BaseModel): + key_hashes: List[str] + r"""Array of API key hashes to unassign from the guardrail""" + + +class BulkUnassignKeysFromGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + request_body: BulkUnassignKeysFromGuardrailRequestBodyTypedDict + + +class BulkUnassignKeysFromGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + request_body: Annotated[ + BulkUnassignKeysFromGuardrailRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +class BulkUnassignKeysFromGuardrailResponseTypedDict(TypedDict): + r"""Unassignment result""" + + unassigned_count: float + r"""Number of keys successfully unassigned""" + + +class BulkUnassignKeysFromGuardrailResponse(BaseModel): + r"""Unassignment result""" + + unassigned_count: float + r"""Number of keys successfully unassigned""" diff --git a/src/openrouter/operations/bulkunassignmembersfromguardrail.py b/src/openrouter/operations/bulkunassignmembersfromguardrail.py new file mode 100644 index 0000000..fde8fad --- /dev/null +++ b/src/openrouter/operations/bulkunassignmembersfromguardrail.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, PathParamMetadata, RequestMetadata +from typing import List +from typing_extensions import Annotated, TypedDict + + +class BulkUnassignMembersFromGuardrailRequestBodyTypedDict(TypedDict): + member_user_ids: List[str] + r"""Array of member user IDs to unassign from the guardrail""" + + +class BulkUnassignMembersFromGuardrailRequestBody(BaseModel): + member_user_ids: List[str] + r"""Array of member user IDs to unassign from the guardrail""" + + +class BulkUnassignMembersFromGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + request_body: BulkUnassignMembersFromGuardrailRequestBodyTypedDict + + +class BulkUnassignMembersFromGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + request_body: Annotated[ + BulkUnassignMembersFromGuardrailRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +class BulkUnassignMembersFromGuardrailResponseTypedDict(TypedDict): + r"""Unassignment result""" + + unassigned_count: float + r"""Number of members successfully unassigned""" + + +class BulkUnassignMembersFromGuardrailResponse(BaseModel): + r"""Unassignment result""" + + unassigned_count: float + r"""Number of members successfully unassigned""" diff --git a/src/openrouter/operations/createguardrail.py b/src/openrouter/operations/createguardrail.py new file mode 100644 index 0000000..d9e8739 --- /dev/null +++ b/src/openrouter/operations/createguardrail.py @@ -0,0 +1,247 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +CreateGuardrailResetIntervalRequest = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class CreateGuardrailRequestTypedDict(TypedDict): + name: str + r"""Name for the new guardrail""" + description: NotRequired[Nullable[str]] + r"""Description of the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""Spending limit in USD""" + reset_interval: NotRequired[Nullable[CreateGuardrailResetIntervalRequest]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""List of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model identifiers (slug or canonical_slug accepted)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + + +class CreateGuardrailRequest(BaseModel): + name: str + r"""Name for the new guardrail""" + + description: OptionalNullable[str] = UNSET + r"""Description of the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""Spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[CreateGuardrailResetIntervalRequest], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""List of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model identifiers (slug or canonical_slug accepted)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + ] + 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 + + +CreateGuardrailResetIntervalResponse = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class CreateGuardrailDataTypedDict(TypedDict): + r"""The created guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + name: str + r"""Name of the guardrail""" + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + description: NotRequired[Nullable[str]] + r"""Description of the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""Spending limit in USD""" + reset_interval: NotRequired[Nullable[CreateGuardrailResetIntervalResponse]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""List of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model canonical_slugs (immutable identifiers)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + updated_at: NotRequired[Nullable[str]] + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + +class CreateGuardrailData(BaseModel): + r"""The created guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + + name: str + r"""Name of the guardrail""" + + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + + description: OptionalNullable[str] = UNSET + r"""Description of the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""Spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[CreateGuardrailResetIntervalResponse], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""List of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model canonical_slugs (immutable identifiers)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + updated_at: OptionalNullable[str] = UNSET + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateGuardrailResponseTypedDict(TypedDict): + r"""Guardrail created successfully""" + + data: CreateGuardrailDataTypedDict + r"""The created guardrail""" + + +class CreateGuardrailResponse(BaseModel): + r"""Guardrail created successfully""" + + data: CreateGuardrailData + r"""The created guardrail""" diff --git a/src/openrouter/operations/deleteguardrail.py b/src/openrouter/operations/deleteguardrail.py new file mode 100644 index 0000000..7210638 --- /dev/null +++ b/src/openrouter/operations/deleteguardrail.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from openrouter.utils import FieldMetadata, PathParamMetadata, validate_const +import pydantic +from pydantic.functional_validators import AfterValidator +from typing import Literal +from typing_extensions import Annotated, TypedDict + + +class DeleteGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail to delete""" + + +class DeleteGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail to delete""" + + +class DeleteGuardrailResponseTypedDict(TypedDict): + r"""Guardrail deleted successfully""" + + deleted: Literal[True] + r"""Confirmation that the guardrail was deleted""" + + +class DeleteGuardrailResponse(BaseModel): + r"""Guardrail deleted successfully""" + + DELETED: Annotated[ + Annotated[Literal[True], AfterValidator(validate_const(True))], + pydantic.Field(alias="deleted"), + ] = True + r"""Confirmation that the guardrail was deleted""" diff --git a/src/openrouter/operations/getguardrail.py b/src/openrouter/operations/getguardrail.py new file mode 100644 index 0000000..603657e --- /dev/null +++ b/src/openrouter/operations/getguardrail.py @@ -0,0 +1,161 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import FieldMetadata, PathParamMetadata, validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail to retrieve""" + + +class GetGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail to retrieve""" + + +GetGuardrailResetInterval = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class GetGuardrailDataTypedDict(TypedDict): + r"""The guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + name: str + r"""Name of the guardrail""" + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + description: NotRequired[Nullable[str]] + r"""Description of the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""Spending limit in USD""" + reset_interval: NotRequired[Nullable[GetGuardrailResetInterval]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""List of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model canonical_slugs (immutable identifiers)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + updated_at: NotRequired[Nullable[str]] + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + +class GetGuardrailData(BaseModel): + r"""The guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + + name: str + r"""Name of the guardrail""" + + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + + description: OptionalNullable[str] = UNSET + r"""Description of the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""Spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[GetGuardrailResetInterval], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""List of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model canonical_slugs (immutable identifiers)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + updated_at: OptionalNullable[str] = UNSET + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class GetGuardrailResponseTypedDict(TypedDict): + r"""Guardrail details""" + + data: GetGuardrailDataTypedDict + r"""The guardrail""" + + +class GetGuardrailResponse(BaseModel): + r"""Guardrail details""" + + data: GetGuardrailData + r"""The guardrail""" diff --git a/src/openrouter/operations/getmodels.py b/src/openrouter/operations/getmodels.py index 526ed1b..dfc79ca 100644 --- a/src/openrouter/operations/getmodels.py +++ b/src/openrouter/operations/getmodels.py @@ -1,22 +1,45 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel -from openrouter.utils import FieldMetadata, QueryParamMetadata -from typing import Optional +from openrouter.types import BaseModel, UnrecognizedStr +from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum +from pydantic.functional_validators import PlainValidator +from typing import Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypedDict +Category = Union[ + Literal[ + "programming", + "roleplay", + "marketing", + "marketing/seo", + "technology", + "science", + "translation", + "legal", + "finance", + "health", + "trivia", + "academia", + ], + UnrecognizedStr, +] +r"""Filter models by use case category""" + + class GetModelsRequestTypedDict(TypedDict): - category: NotRequired[str] + category: NotRequired[Category] + r"""Filter models by use case category""" supported_parameters: NotRequired[str] class GetModelsRequest(BaseModel): category: Annotated[ - Optional[str], + Annotated[Optional[Category], PlainValidator(validate_open_enum(False))], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = None + r"""Filter models by use case category""" supported_parameters: Annotated[ Optional[str], diff --git a/src/openrouter/operations/getparameters.py b/src/openrouter/operations/getparameters.py deleted file mode 100644 index 2ae70a2..0000000 --- a/src/openrouter/operations/getparameters.py +++ /dev/null @@ -1,123 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.components import providername as components_providername -from openrouter.types import BaseModel, UnrecognizedStr -from openrouter.utils import ( - FieldMetadata, - PathParamMetadata, - QueryParamMetadata, - SecurityMetadata, - validate_open_enum, -) -from pydantic.functional_validators import PlainValidator -from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict - - -class GetParametersSecurityTypedDict(TypedDict): - bearer: str - - -class GetParametersSecurity(BaseModel): - bearer: Annotated[ - str, - FieldMetadata( - security=SecurityMetadata( - scheme=True, - scheme_type="http", - sub_type="bearer", - field_name="Authorization", - ) - ), - ] - - -class GetParametersRequestTypedDict(TypedDict): - author: str - slug: str - provider: NotRequired[components_providername.ProviderName] - - -class GetParametersRequest(BaseModel): - author: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - slug: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - provider: Annotated[ - Annotated[ - Optional[components_providername.ProviderName], - PlainValidator(validate_open_enum(False)), - ], - FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), - ] = None - - -SupportedParameter = Union[ - Literal[ - "temperature", - "top_p", - "top_k", - "min_p", - "top_a", - "frequency_penalty", - "presence_penalty", - "repetition_penalty", - "max_tokens", - "logit_bias", - "logprobs", - "top_logprobs", - "seed", - "response_format", - "structured_outputs", - "stop", - "tools", - "tool_choice", - "parallel_tool_calls", - "include_reasoning", - "reasoning", - "reasoning_effort", - "web_search_options", - "verbosity", - ], - UnrecognizedStr, -] - - -class GetParametersDataTypedDict(TypedDict): - r"""Parameter analytics data""" - - model: str - r"""Model identifier""" - supported_parameters: List[SupportedParameter] - r"""List of parameters supported by this model""" - - -class GetParametersData(BaseModel): - r"""Parameter analytics data""" - - model: str - r"""Model identifier""" - - supported_parameters: List[ - Annotated[SupportedParameter, PlainValidator(validate_open_enum(False))] - ] - r"""List of parameters supported by this model""" - - -class GetParametersResponseTypedDict(TypedDict): - r"""Returns the parameters for the specified model""" - - data: GetParametersDataTypedDict - r"""Parameter analytics data""" - - -class GetParametersResponse(BaseModel): - r"""Returns the parameters for the specified model""" - - data: GetParametersData - r"""Parameter analytics data""" diff --git a/src/openrouter/operations/listguardrailkeyassignments.py b/src/openrouter/operations/listguardrailkeyassignments.py new file mode 100644 index 0000000..68a20aa --- /dev/null +++ b/src/openrouter/operations/listguardrailkeyassignments.py @@ -0,0 +1,125 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListGuardrailKeyAssignmentsRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + offset: NotRequired[str] + r"""Number of records to skip for pagination""" + limit: NotRequired[str] + r"""Maximum number of records to return (max 100)""" + + +class ListGuardrailKeyAssignmentsRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + offset: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Number of records to skip for pagination""" + + limit: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of records to return (max 100)""" + + +class ListGuardrailKeyAssignmentsDataTypedDict(TypedDict): + id: str + r"""Unique identifier for the assignment""" + key_hash: str + r"""Hash of the assigned API key""" + guardrail_id: str + r"""ID of the guardrail""" + key_name: str + r"""Name of the API key""" + key_label: str + r"""Label of the API key""" + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + +class ListGuardrailKeyAssignmentsData(BaseModel): + id: str + r"""Unique identifier for the assignment""" + + key_hash: str + r"""Hash of the assigned API key""" + + guardrail_id: str + r"""ID of the guardrail""" + + key_name: str + r"""Name of the API key""" + + key_label: str + r"""Label of the API key""" + + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["assigned_by"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ListGuardrailKeyAssignmentsResponseTypedDict(TypedDict): + r"""List of key assignments""" + + data: List[ListGuardrailKeyAssignmentsDataTypedDict] + r"""List of key assignments""" + total_count: float + r"""Total number of key assignments for this guardrail""" + + +class ListGuardrailKeyAssignmentsResponse(BaseModel): + r"""List of key assignments""" + + data: List[ListGuardrailKeyAssignmentsData] + r"""List of key assignments""" + + total_count: float + r"""Total number of key assignments for this guardrail""" diff --git a/src/openrouter/operations/listguardrailmemberassignments.py b/src/openrouter/operations/listguardrailmemberassignments.py new file mode 100644 index 0000000..cb81a7b --- /dev/null +++ b/src/openrouter/operations/listguardrailmemberassignments.py @@ -0,0 +1,120 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListGuardrailMemberAssignmentsRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail""" + offset: NotRequired[str] + r"""Number of records to skip for pagination""" + limit: NotRequired[str] + r"""Maximum number of records to return (max 100)""" + + +class ListGuardrailMemberAssignmentsRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail""" + + offset: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Number of records to skip for pagination""" + + limit: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of records to return (max 100)""" + + +class ListGuardrailMemberAssignmentsDataTypedDict(TypedDict): + id: str + r"""Unique identifier for the assignment""" + user_id: str + r"""Clerk user ID of the assigned member""" + organization_id: str + r"""Organization ID""" + guardrail_id: str + r"""ID of the guardrail""" + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + +class ListGuardrailMemberAssignmentsData(BaseModel): + id: str + r"""Unique identifier for the assignment""" + + user_id: str + r"""Clerk user ID of the assigned member""" + + organization_id: str + r"""Organization ID""" + + guardrail_id: str + r"""ID of the guardrail""" + + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["assigned_by"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ListGuardrailMemberAssignmentsResponseTypedDict(TypedDict): + r"""List of member assignments""" + + data: List[ListGuardrailMemberAssignmentsDataTypedDict] + r"""List of member assignments""" + total_count: float + r"""Total number of member assignments""" + + +class ListGuardrailMemberAssignmentsResponse(BaseModel): + r"""List of member assignments""" + + data: List[ListGuardrailMemberAssignmentsData] + r"""List of member assignments""" + + total_count: float + r"""Total number of member assignments""" diff --git a/src/openrouter/operations/listguardrails.py b/src/openrouter/operations/listguardrails.py new file mode 100644 index 0000000..4452312 --- /dev/null +++ b/src/openrouter/operations/listguardrails.py @@ -0,0 +1,171 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import FieldMetadata, QueryParamMetadata, validate_open_enum +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListGuardrailsRequestTypedDict(TypedDict): + offset: NotRequired[str] + r"""Number of records to skip for pagination""" + limit: NotRequired[str] + r"""Maximum number of records to return (max 100)""" + + +class ListGuardrailsRequest(BaseModel): + offset: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Number of records to skip for pagination""" + + limit: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of records to return (max 100)""" + + +ListGuardrailsResetInterval = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class ListGuardrailsDataTypedDict(TypedDict): + id: str + r"""Unique identifier for the guardrail""" + name: str + r"""Name of the guardrail""" + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + description: NotRequired[Nullable[str]] + r"""Description of the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""Spending limit in USD""" + reset_interval: NotRequired[Nullable[ListGuardrailsResetInterval]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""List of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model canonical_slugs (immutable identifiers)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + updated_at: NotRequired[Nullable[str]] + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + +class ListGuardrailsData(BaseModel): + id: str + r"""Unique identifier for the guardrail""" + + name: str + r"""Name of the guardrail""" + + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + + description: OptionalNullable[str] = UNSET + r"""Description of the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""Spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[ListGuardrailsResetInterval], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""List of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model canonical_slugs (immutable identifiers)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + updated_at: OptionalNullable[str] = UNSET + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ListGuardrailsResponseTypedDict(TypedDict): + r"""List of guardrails""" + + data: List[ListGuardrailsDataTypedDict] + r"""List of guardrails""" + total_count: float + r"""Total number of guardrails""" + + +class ListGuardrailsResponse(BaseModel): + r"""List of guardrails""" + + data: List[ListGuardrailsData] + r"""List of guardrails""" + + total_count: float + r"""Total number of guardrails""" diff --git a/src/openrouter/operations/listkeyassignments.py b/src/openrouter/operations/listkeyassignments.py new file mode 100644 index 0000000..c54ebb6 --- /dev/null +++ b/src/openrouter/operations/listkeyassignments.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListKeyAssignmentsRequestTypedDict(TypedDict): + offset: NotRequired[str] + r"""Number of records to skip for pagination""" + limit: NotRequired[str] + r"""Maximum number of records to return (max 100)""" + + +class ListKeyAssignmentsRequest(BaseModel): + offset: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Number of records to skip for pagination""" + + limit: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of records to return (max 100)""" + + +class ListKeyAssignmentsDataTypedDict(TypedDict): + id: str + r"""Unique identifier for the assignment""" + key_hash: str + r"""Hash of the assigned API key""" + guardrail_id: str + r"""ID of the guardrail""" + key_name: str + r"""Name of the API key""" + key_label: str + r"""Label of the API key""" + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + +class ListKeyAssignmentsData(BaseModel): + id: str + r"""Unique identifier for the assignment""" + + key_hash: str + r"""Hash of the assigned API key""" + + guardrail_id: str + r"""ID of the guardrail""" + + key_name: str + r"""Name of the API key""" + + key_label: str + r"""Label of the API key""" + + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["assigned_by"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ListKeyAssignmentsResponseTypedDict(TypedDict): + r"""List of key assignments""" + + data: List[ListKeyAssignmentsDataTypedDict] + r"""List of key assignments""" + total_count: float + r"""Total number of key assignments for this guardrail""" + + +class ListKeyAssignmentsResponse(BaseModel): + r"""List of key assignments""" + + data: List[ListKeyAssignmentsData] + r"""List of key assignments""" + + total_count: float + r"""Total number of key assignments for this guardrail""" diff --git a/src/openrouter/operations/listmemberassignments.py b/src/openrouter/operations/listmemberassignments.py new file mode 100644 index 0000000..5adb2b5 --- /dev/null +++ b/src/openrouter/operations/listmemberassignments.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.utils import FieldMetadata, QueryParamMetadata +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListMemberAssignmentsRequestTypedDict(TypedDict): + offset: NotRequired[str] + r"""Number of records to skip for pagination""" + limit: NotRequired[str] + r"""Maximum number of records to return (max 100)""" + + +class ListMemberAssignmentsRequest(BaseModel): + offset: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Number of records to skip for pagination""" + + limit: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Maximum number of records to return (max 100)""" + + +class ListMemberAssignmentsDataTypedDict(TypedDict): + id: str + r"""Unique identifier for the assignment""" + user_id: str + r"""Clerk user ID of the assigned member""" + organization_id: str + r"""Organization ID""" + guardrail_id: str + r"""ID of the guardrail""" + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + +class ListMemberAssignmentsData(BaseModel): + id: str + r"""Unique identifier for the assignment""" + + user_id: str + r"""Clerk user ID of the assigned member""" + + organization_id: str + r"""Organization ID""" + + guardrail_id: str + r"""ID of the guardrail""" + + assigned_by: Nullable[str] + r"""User ID of who made the assignment""" + + created_at: str + r"""ISO 8601 timestamp of when the assignment was created""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [] + nullable_fields = ["assigned_by"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ListMemberAssignmentsResponseTypedDict(TypedDict): + r"""List of member assignments""" + + data: List[ListMemberAssignmentsDataTypedDict] + r"""List of member assignments""" + total_count: float + r"""Total number of member assignments""" + + +class ListMemberAssignmentsResponse(BaseModel): + r"""List of member assignments""" + + data: List[ListMemberAssignmentsData] + r"""List of member assignments""" + + total_count: float + r"""Total number of member assignments""" diff --git a/src/openrouter/operations/updateguardrail.py b/src/openrouter/operations/updateguardrail.py new file mode 100644 index 0000000..7667861 --- /dev/null +++ b/src/openrouter/operations/updateguardrail.py @@ -0,0 +1,271 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from openrouter.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, + validate_open_enum, +) +from pydantic import model_serializer +from pydantic.functional_validators import PlainValidator +from typing import List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +UpdateGuardrailResetIntervalRequest = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class UpdateGuardrailRequestBodyTypedDict(TypedDict): + name: NotRequired[str] + r"""New name for the guardrail""" + description: NotRequired[Nullable[str]] + r"""New description for the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""New spending limit in USD""" + reset_interval: NotRequired[Nullable[UpdateGuardrailResetIntervalRequest]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""New list of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model identifiers (slug or canonical_slug accepted)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + + +class UpdateGuardrailRequestBody(BaseModel): + name: Optional[str] = None + r"""New name for the guardrail""" + + description: OptionalNullable[str] = UNSET + r"""New description for the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""New spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[UpdateGuardrailResetIntervalRequest], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""New list of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model identifiers (slug or canonical_slug accepted)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "name", + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateGuardrailRequestTypedDict(TypedDict): + id: str + r"""The unique identifier of the guardrail to update""" + request_body: UpdateGuardrailRequestBodyTypedDict + + +class UpdateGuardrailRequest(BaseModel): + id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The unique identifier of the guardrail to update""" + + request_body: Annotated[ + UpdateGuardrailRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + +UpdateGuardrailResetIntervalResponse = Union[ + Literal[ + "daily", + "weekly", + "monthly", + ], + UnrecognizedStr, +] +r"""Interval at which the limit resets (daily, weekly, monthly)""" + + +class UpdateGuardrailDataTypedDict(TypedDict): + r"""The updated guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + name: str + r"""Name of the guardrail""" + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + description: NotRequired[Nullable[str]] + r"""Description of the guardrail""" + limit_usd: NotRequired[Nullable[float]] + r"""Spending limit in USD""" + reset_interval: NotRequired[Nullable[UpdateGuardrailResetIntervalResponse]] + r"""Interval at which the limit resets (daily, weekly, monthly)""" + allowed_providers: NotRequired[Nullable[List[str]]] + r"""List of allowed provider IDs""" + allowed_models: NotRequired[Nullable[List[str]]] + r"""Array of model canonical_slugs (immutable identifiers)""" + enforce_zdr: NotRequired[Nullable[bool]] + r"""Whether to enforce zero data retention""" + updated_at: NotRequired[Nullable[str]] + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + +class UpdateGuardrailData(BaseModel): + r"""The updated guardrail""" + + id: str + r"""Unique identifier for the guardrail""" + + name: str + r"""Name of the guardrail""" + + created_at: str + r"""ISO 8601 timestamp of when the guardrail was created""" + + description: OptionalNullable[str] = UNSET + r"""Description of the guardrail""" + + limit_usd: OptionalNullable[float] = UNSET + r"""Spending limit in USD""" + + reset_interval: Annotated[ + OptionalNullable[UpdateGuardrailResetIntervalResponse], + PlainValidator(validate_open_enum(False)), + ] = UNSET + r"""Interval at which the limit resets (daily, weekly, monthly)""" + + allowed_providers: OptionalNullable[List[str]] = UNSET + r"""List of allowed provider IDs""" + + allowed_models: OptionalNullable[List[str]] = UNSET + r"""Array of model canonical_slugs (immutable identifiers)""" + + enforce_zdr: OptionalNullable[bool] = UNSET + r"""Whether to enforce zero data retention""" + + updated_at: OptionalNullable[str] = UNSET + r"""ISO 8601 timestamp of when the guardrail was last updated""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + nullable_fields = [ + "description", + "limit_usd", + "reset_interval", + "allowed_providers", + "allowed_models", + "enforce_zdr", + "updated_at", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateGuardrailResponseTypedDict(TypedDict): + r"""Guardrail updated successfully""" + + data: UpdateGuardrailDataTypedDict + r"""The updated guardrail""" + + +class UpdateGuardrailResponse(BaseModel): + r"""Guardrail updated successfully""" + + data: UpdateGuardrailData + r"""The updated guardrail""" diff --git a/src/openrouter/parameters.py b/src/openrouter/parameters.py deleted file mode 100644 index d645cb1..0000000 --- a/src/openrouter/parameters.py +++ /dev/null @@ -1,237 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from .basesdk import BaseSDK -from openrouter import components, errors, operations, utils -from openrouter._hooks import HookContext -from openrouter.types import OptionalNullable, UNSET -from openrouter.utils import get_security_from_env -from openrouter.utils.unmarshal_json_response import unmarshal_json_response -from typing import Any, Mapping, Optional, Union - - -class Parameters(BaseSDK): - r"""Parameters endpoints""" - - def get_parameters( - self, - *, - security: Union[ - operations.GetParametersSecurity, operations.GetParametersSecurityTypedDict - ], - author: str, - slug: str, - provider: Optional[components.ProviderName] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetParametersResponse: - r"""Get a model's supported parameters and data about which are most popular - - :param security: - :param author: - :param slug: - :param provider: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetParametersRequest( - author=author, - slug=slug, - provider=provider, - ) - - req = self._build_request( - method="GET", - path="/parameters/{author}/{slug}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, operations.GetParametersSecurity - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = self.do_request( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getParameters", - oauth2_scopes=None, - security_source=get_security_from_env(security, components.Security), - ), - request=req, - error_status_codes=["401", "404", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(operations.GetParametersResponse, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) - - async def get_parameters_async( - self, - *, - security: Union[ - operations.GetParametersSecurity, operations.GetParametersSecurityTypedDict - ], - author: str, - slug: str, - provider: Optional[components.ProviderName] = None, - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetParametersResponse: - r"""Get a model's supported parameters and data about which are most popular - - :param security: - :param author: - :param slug: - :param provider: - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :param timeout_ms: Override the default request timeout configuration for this method in milliseconds - :param http_headers: Additional headers to set or replace on requests. - """ - base_url = None - url_variables = None - if timeout_ms is None: - timeout_ms = self.sdk_configuration.timeout_ms - - if server_url is not None: - base_url = server_url - else: - base_url = self._get_url(base_url, url_variables) - - request = operations.GetParametersRequest( - author=author, - slug=slug, - provider=provider, - ) - - req = self._build_request_async( - method="GET", - path="/parameters/{author}/{slug}", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=utils.get_pydantic_model( - security, operations.GetParametersSecurity - ), - allow_empty_value=None, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["429", "500", "502", "503", "504"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - config=self.sdk_configuration, - base_url=base_url or "", - operation_id="getParameters", - oauth2_scopes=None, - security_source=get_security_from_env(security, components.Security), - ), - request=req, - error_status_codes=["401", "404", "4XX", "500", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return unmarshal_json_response(operations.GetParametersResponse, http_res) - if utils.match_response(http_res, "401", "application/json"): - response_data = unmarshal_json_response( - errors.UnauthorizedResponseErrorData, http_res - ) - raise errors.UnauthorizedResponseError(response_data, http_res) - if utils.match_response(http_res, "404", "application/json"): - response_data = unmarshal_json_response( - errors.NotFoundResponseErrorData, http_res - ) - raise errors.NotFoundResponseError(response_data, http_res) - if utils.match_response(http_res, "500", "application/json"): - response_data = unmarshal_json_response( - errors.InternalServerResponseErrorData, http_res - ) - raise errors.InternalServerResponseError(response_data, http_res) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.OpenRouterDefaultError( - "API error occurred", http_res, http_res_text - ) - - raise errors.OpenRouterDefaultError("Unexpected response received", http_res) diff --git a/src/openrouter/sdk.py b/src/openrouter/sdk.py index a71e057..03b39eb 100644 --- a/src/openrouter/sdk.py +++ b/src/openrouter/sdk.py @@ -25,9 +25,9 @@ if TYPE_CHECKING: from openrouter.embeddings import Embeddings from openrouter.endpoints import Endpoints from openrouter.generations import Generations + from openrouter.guardrails import Guardrails from openrouter.models_ import Models from openrouter.oauth import OAuth - from openrouter.parameters import Parameters from openrouter.providers import Providers @@ -49,12 +49,12 @@ class OpenRouter(BaseSDK): r"""Model information endpoints""" endpoints: "Endpoints" r"""Endpoint information""" - parameters: "Parameters" - r"""Parameters endpoints""" providers: "Providers" r"""Provider information endpoints""" api_keys: "APIKeys" r"""API key management endpoints""" + guardrails: "Guardrails" + r"""Guardrails endpoints""" o_auth: "OAuth" r"""OAuth authentication endpoints""" chat: "Chat" @@ -67,9 +67,9 @@ class OpenRouter(BaseSDK): "generations": ("openrouter.generations", "Generations"), "models": ("openrouter.models_", "Models"), "endpoints": ("openrouter.endpoints", "Endpoints"), - "parameters": ("openrouter.parameters", "Parameters"), "providers": ("openrouter.providers", "Providers"), "api_keys": ("openrouter.api_keys", "APIKeys"), + "guardrails": ("openrouter.guardrails", "Guardrails"), "o_auth": ("openrouter.oauth", "OAuth"), "chat": ("openrouter.chat", "Chat"), "completions": ("openrouter.completions", "Completions"), diff --git a/src/openrouter/types/models.py b/src/openrouter/types/models.py new file mode 100644 index 0000000..9f68ee9 --- /dev/null +++ b/src/openrouter/types/models.py @@ -0,0 +1,378 @@ +"""Auto-generated by @openrouter/cli types. Do not edit manually.""" +# Run `npx @openrouter/cli types` to regenerate +# Generated: 2025-12-23T14:51:29.122Z +# Model count: 351 + +from typing import Literal, Union +from typing_extensions import TypeAlias + +# Union type of all available model IDs on OpenRouter. +# Includes base models and their variants (e.g., ":free", ":nitro"). +ModelId: TypeAlias = Literal[ + 'ai21/jamba-large-1.7', + 'ai21/jamba-mini-1.7', + 'aion-labs/aion-1.0', + 'aion-labs/aion-1.0-mini', + 'aion-labs/aion-rp-llama-3.1-8b', + 'alfredpros/codellama-7b-instruct-solidity', + 'alibaba/tongyi-deepresearch-30b-a3b', + 'alibaba/tongyi-deepresearch-30b-a3b:free', + 'allenai/olmo-2-0325-32b-instruct', + 'allenai/olmo-3-32b-think:free', + 'allenai/olmo-3-7b-instruct', + 'allenai/olmo-3-7b-think', + 'allenai/olmo-3.1-32b-think:free', + 'alpindale/goliath-120b', + 'amazon/nova-2-lite-v1', + 'amazon/nova-lite-v1', + 'amazon/nova-micro-v1', + 'amazon/nova-premier-v1', + 'amazon/nova-pro-v1', + 'anthracite-org/magnum-v4-72b', + 'anthropic/claude-3-haiku', + 'anthropic/claude-3-opus', + 'anthropic/claude-3.5-haiku', + 'anthropic/claude-3.5-haiku-20241022', + 'anthropic/claude-3.5-sonnet', + 'anthropic/claude-3.7-sonnet', + 'anthropic/claude-3.7-sonnet:thinking', + 'anthropic/claude-haiku-4.5', + 'anthropic/claude-opus-4', + 'anthropic/claude-opus-4.1', + 'anthropic/claude-opus-4.5', + 'anthropic/claude-sonnet-4', + 'anthropic/claude-sonnet-4.5', + 'arcee-ai/coder-large', + 'arcee-ai/maestro-reasoning', + 'arcee-ai/spotlight', + 'arcee-ai/trinity-mini', + 'arcee-ai/trinity-mini:free', + 'arcee-ai/virtuoso-large', + 'arliai/qwq-32b-arliai-rpr-v1', + 'baidu/ernie-4.5-21b-a3b', + 'baidu/ernie-4.5-21b-a3b-thinking', + 'baidu/ernie-4.5-300b-a47b', + 'baidu/ernie-4.5-vl-28b-a3b', + 'baidu/ernie-4.5-vl-424b-a47b', + 'bytedance/ui-tars-1.5-7b', + 'cognitivecomputations/dolphin-mistral-24b-venice-edition:free', + 'cohere/command-a', + 'cohere/command-r-08-2024', + 'cohere/command-r-plus-08-2024', + 'cohere/command-r7b-12-2024', + 'deepcogito/cogito-v2-preview-llama-109b-moe', + 'deepcogito/cogito-v2-preview-llama-405b', + 'deepcogito/cogito-v2-preview-llama-70b', + 'deepcogito/cogito-v2.1-671b', + 'deepseek/deepseek-chat', + 'deepseek/deepseek-chat-v3-0324', + 'deepseek/deepseek-chat-v3.1', + 'deepseek/deepseek-prover-v2', + 'deepseek/deepseek-r1', + 'deepseek/deepseek-r1-0528', + 'deepseek/deepseek-r1-0528-qwen3-8b', + 'deepseek/deepseek-r1-0528:free', + 'deepseek/deepseek-r1-distill-llama-70b', + 'deepseek/deepseek-r1-distill-qwen-14b', + 'deepseek/deepseek-r1-distill-qwen-32b', + 'deepseek/deepseek-v3.1-terminus', + 'deepseek/deepseek-v3.1-terminus:exacto', + 'deepseek/deepseek-v3.2', + 'deepseek/deepseek-v3.2-exp', + 'deepseek/deepseek-v3.2-speciale', + 'eleutherai/llemma_7b', + 'essentialai/rnj-1-instruct', + 'google/gemini-2.0-flash-001', + 'google/gemini-2.0-flash-exp:free', + 'google/gemini-2.0-flash-lite-001', + 'google/gemini-2.5-flash', + 'google/gemini-2.5-flash-image', + 'google/gemini-2.5-flash-image-preview', + 'google/gemini-2.5-flash-lite', + 'google/gemini-2.5-flash-lite-preview-09-2025', + 'google/gemini-2.5-flash-preview-09-2025', + 'google/gemini-2.5-pro', + 'google/gemini-2.5-pro-preview', + 'google/gemini-2.5-pro-preview-05-06', + 'google/gemini-3-flash-preview', + 'google/gemini-3-pro-image-preview', + 'google/gemini-3-pro-preview', + 'google/gemma-2-27b-it', + 'google/gemma-2-9b-it', + 'google/gemma-3-12b-it', + 'google/gemma-3-12b-it:free', + 'google/gemma-3-27b-it', + 'google/gemma-3-27b-it:free', + 'google/gemma-3-4b-it', + 'google/gemma-3-4b-it:free', + 'google/gemma-3n-e2b-it:free', + 'google/gemma-3n-e4b-it', + 'google/gemma-3n-e4b-it:free', + 'gryphe/mythomax-l2-13b', + 'ibm-granite/granite-4.0-h-micro', + 'inception/mercury', + 'inception/mercury-coder', + 'inflection/inflection-3-pi', + 'inflection/inflection-3-productivity', + 'kwaipilot/kat-coder-pro:free', + 'liquid/lfm-2.2-6b', + 'liquid/lfm2-8b-a1b', + 'mancer/weaver', + 'meituan/longcat-flash-chat', + 'meta-llama/llama-3-70b-instruct', + 'meta-llama/llama-3-8b-instruct', + 'meta-llama/llama-3.1-405b', + 'meta-llama/llama-3.1-405b-instruct', + 'meta-llama/llama-3.1-405b-instruct:free', + 'meta-llama/llama-3.1-70b-instruct', + 'meta-llama/llama-3.1-8b-instruct', + 'meta-llama/llama-3.2-11b-vision-instruct', + 'meta-llama/llama-3.2-1b-instruct', + 'meta-llama/llama-3.2-3b-instruct', + 'meta-llama/llama-3.2-3b-instruct:free', + 'meta-llama/llama-3.2-90b-vision-instruct', + 'meta-llama/llama-3.3-70b-instruct', + 'meta-llama/llama-3.3-70b-instruct:free', + 'meta-llama/llama-4-maverick', + 'meta-llama/llama-4-scout', + 'meta-llama/llama-guard-2-8b', + 'meta-llama/llama-guard-3-8b', + 'meta-llama/llama-guard-4-12b', + 'microsoft/phi-3-medium-128k-instruct', + 'microsoft/phi-3-mini-128k-instruct', + 'microsoft/phi-3.5-mini-128k-instruct', + 'microsoft/phi-4', + 'microsoft/phi-4-multimodal-instruct', + 'microsoft/phi-4-reasoning-plus', + 'microsoft/wizardlm-2-8x22b', + 'minimax/minimax-01', + 'minimax/minimax-m1', + 'minimax/minimax-m2', + 'minimax/minimax-m2.1', + 'mistralai/codestral-2508', + 'mistralai/devstral-2512', + 'mistralai/devstral-2512:free', + 'mistralai/devstral-medium', + 'mistralai/devstral-small', + 'mistralai/devstral-small-2505', + 'mistralai/ministral-14b-2512', + 'mistralai/ministral-3b', + 'mistralai/ministral-3b-2512', + 'mistralai/ministral-8b', + 'mistralai/ministral-8b-2512', + 'mistralai/mistral-7b-instruct', + 'mistralai/mistral-7b-instruct-v0.1', + 'mistralai/mistral-7b-instruct-v0.2', + 'mistralai/mistral-7b-instruct-v0.3', + 'mistralai/mistral-7b-instruct:free', + 'mistralai/mistral-large', + 'mistralai/mistral-large-2407', + 'mistralai/mistral-large-2411', + 'mistralai/mistral-large-2512', + 'mistralai/mistral-medium-3', + 'mistralai/mistral-medium-3.1', + 'mistralai/mistral-nemo', + 'mistralai/mistral-saba', + 'mistralai/mistral-small-24b-instruct-2501', + 'mistralai/mistral-small-3.1-24b-instruct', + 'mistralai/mistral-small-3.1-24b-instruct:free', + 'mistralai/mistral-small-3.2-24b-instruct', + 'mistralai/mistral-small-creative', + 'mistralai/mistral-tiny', + 'mistralai/mixtral-8x22b-instruct', + 'mistralai/mixtral-8x7b-instruct', + 'mistralai/pixtral-12b', + 'mistralai/pixtral-large-2411', + 'mistralai/voxtral-small-24b-2507', + 'moonshotai/kimi-dev-72b', + 'moonshotai/kimi-k2', + 'moonshotai/kimi-k2-0905', + 'moonshotai/kimi-k2-0905:exacto', + 'moonshotai/kimi-k2-thinking', + 'moonshotai/kimi-k2:free', + 'morph/morph-v3-fast', + 'morph/morph-v3-large', + 'neversleep/llama-3.1-lumimaid-8b', + 'neversleep/noromaid-20b', + 'nex-agi/deepseek-v3.1-nex-n1:free', + 'nousresearch/deephermes-3-mistral-24b-preview', + 'nousresearch/hermes-2-pro-llama-3-8b', + 'nousresearch/hermes-3-llama-3.1-405b', + 'nousresearch/hermes-3-llama-3.1-405b:free', + 'nousresearch/hermes-3-llama-3.1-70b', + 'nousresearch/hermes-4-405b', + 'nousresearch/hermes-4-70b', + 'nvidia/llama-3.1-nemotron-70b-instruct', + 'nvidia/llama-3.1-nemotron-ultra-253b-v1', + 'nvidia/llama-3.3-nemotron-super-49b-v1.5', + 'nvidia/nemotron-3-nano-30b-a3b', + 'nvidia/nemotron-3-nano-30b-a3b:free', + 'nvidia/nemotron-nano-12b-v2-vl', + 'nvidia/nemotron-nano-12b-v2-vl:free', + 'nvidia/nemotron-nano-9b-v2', + 'nvidia/nemotron-nano-9b-v2:free', + 'openai/chatgpt-4o-latest', + 'openai/codex-mini', + 'openai/gpt-3.5-turbo', + 'openai/gpt-3.5-turbo-0613', + 'openai/gpt-3.5-turbo-16k', + 'openai/gpt-3.5-turbo-instruct', + 'openai/gpt-4', + 'openai/gpt-4-0314', + 'openai/gpt-4-1106-preview', + 'openai/gpt-4-turbo', + 'openai/gpt-4-turbo-preview', + 'openai/gpt-4.1', + 'openai/gpt-4.1-mini', + 'openai/gpt-4.1-nano', + 'openai/gpt-4o', + 'openai/gpt-4o-2024-05-13', + 'openai/gpt-4o-2024-08-06', + 'openai/gpt-4o-2024-11-20', + 'openai/gpt-4o-audio-preview', + 'openai/gpt-4o-mini', + 'openai/gpt-4o-mini-2024-07-18', + 'openai/gpt-4o-mini-search-preview', + 'openai/gpt-4o-search-preview', + 'openai/gpt-4o:extended', + 'openai/gpt-5', + 'openai/gpt-5-chat', + 'openai/gpt-5-codex', + 'openai/gpt-5-image', + 'openai/gpt-5-image-mini', + 'openai/gpt-5-mini', + 'openai/gpt-5-nano', + 'openai/gpt-5-pro', + 'openai/gpt-5.1', + 'openai/gpt-5.1-chat', + 'openai/gpt-5.1-codex', + 'openai/gpt-5.1-codex-max', + 'openai/gpt-5.1-codex-mini', + 'openai/gpt-5.2', + 'openai/gpt-5.2-chat', + 'openai/gpt-5.2-pro', + 'openai/gpt-oss-120b', + 'openai/gpt-oss-120b:exacto', + 'openai/gpt-oss-120b:free', + 'openai/gpt-oss-20b', + 'openai/gpt-oss-20b:free', + 'openai/gpt-oss-safeguard-20b', + 'openai/o1', + 'openai/o1-pro', + 'openai/o3', + 'openai/o3-deep-research', + 'openai/o3-mini', + 'openai/o3-mini-high', + 'openai/o3-pro', + 'openai/o4-mini', + 'openai/o4-mini-deep-research', + 'openai/o4-mini-high', + 'opengvlab/internvl3-78b', + 'openrouter/auto', + 'openrouter/bodybuilder', + 'perplexity/sonar', + 'perplexity/sonar-deep-research', + 'perplexity/sonar-pro', + 'perplexity/sonar-pro-search', + 'perplexity/sonar-reasoning', + 'perplexity/sonar-reasoning-pro', + 'prime-intellect/intellect-3', + 'qwen/qwen-2.5-72b-instruct', + 'qwen/qwen-2.5-7b-instruct', + 'qwen/qwen-2.5-coder-32b-instruct', + 'qwen/qwen-2.5-vl-7b-instruct', + 'qwen/qwen-2.5-vl-7b-instruct:free', + 'qwen/qwen-max', + 'qwen/qwen-plus', + 'qwen/qwen-plus-2025-07-28', + 'qwen/qwen-plus-2025-07-28:thinking', + 'qwen/qwen-turbo', + 'qwen/qwen-vl-max', + 'qwen/qwen-vl-plus', + 'qwen/qwen2.5-coder-7b-instruct', + 'qwen/qwen2.5-vl-32b-instruct', + 'qwen/qwen2.5-vl-72b-instruct', + 'qwen/qwen3-14b', + 'qwen/qwen3-235b-a22b', + 'qwen/qwen3-235b-a22b-2507', + 'qwen/qwen3-235b-a22b-thinking-2507', + 'qwen/qwen3-30b-a3b', + 'qwen/qwen3-30b-a3b-instruct-2507', + 'qwen/qwen3-30b-a3b-thinking-2507', + 'qwen/qwen3-32b', + 'qwen/qwen3-4b:free', + 'qwen/qwen3-8b', + 'qwen/qwen3-coder', + 'qwen/qwen3-coder-30b-a3b-instruct', + 'qwen/qwen3-coder-flash', + 'qwen/qwen3-coder-plus', + 'qwen/qwen3-coder:exacto', + 'qwen/qwen3-coder:free', + 'qwen/qwen3-max', + 'qwen/qwen3-next-80b-a3b-instruct', + 'qwen/qwen3-next-80b-a3b-thinking', + 'qwen/qwen3-vl-235b-a22b-instruct', + 'qwen/qwen3-vl-235b-a22b-thinking', + 'qwen/qwen3-vl-30b-a3b-instruct', + 'qwen/qwen3-vl-30b-a3b-thinking', + 'qwen/qwen3-vl-32b-instruct', + 'qwen/qwen3-vl-8b-instruct', + 'qwen/qwen3-vl-8b-thinking', + 'qwen/qwq-32b', + 'raifle/sorcererlm-8x22b', + 'relace/relace-apply-3', + 'relace/relace-search', + 'sao10k/l3-euryale-70b', + 'sao10k/l3-lunaris-8b', + 'sao10k/l3.1-70b-hanami-x1', + 'sao10k/l3.1-euryale-70b', + 'sao10k/l3.3-euryale-70b', + 'stepfun-ai/step3', + 'switchpoint/router', + 'tencent/hunyuan-a13b-instruct', + 'thedrummer/cydonia-24b-v4.1', + 'thedrummer/rocinante-12b', + 'thedrummer/skyfall-36b-v2', + 'thedrummer/unslopnemo-12b', + 'thudm/glm-4.1v-9b-thinking', + 'tngtech/deepseek-r1t-chimera', + 'tngtech/deepseek-r1t-chimera:free', + 'tngtech/deepseek-r1t2-chimera', + 'tngtech/deepseek-r1t2-chimera:free', + 'tngtech/tng-r1t-chimera', + 'tngtech/tng-r1t-chimera:free', + 'undi95/remm-slerp-l2-13b', + 'x-ai/grok-3', + 'x-ai/grok-3-beta', + 'x-ai/grok-3-mini', + 'x-ai/grok-3-mini-beta', + 'x-ai/grok-4', + 'x-ai/grok-4-fast', + 'x-ai/grok-4.1-fast', + 'x-ai/grok-code-fast-1', + 'xiaomi/mimo-v2-flash:free', + 'z-ai/glm-4-32b', + 'z-ai/glm-4.5', + 'z-ai/glm-4.5-air', + 'z-ai/glm-4.5-air:free', + 'z-ai/glm-4.5v', + 'z-ai/glm-4.6', + 'z-ai/glm-4.6:exacto', + 'z-ai/glm-4.6v', + 'z-ai/glm-4.7' +] + +# Static variants that create distinct model IDs. +# These are already present in the API response (e.g., "openai/gpt-4:free"). +StaticVariant: TypeAlias = Literal['free', 'extended', 'exacto', 'thinking'] + +# Virtual variants used for routing hints. +# These do not create distinct model IDs but affect routing behavior. +VirtualVariant: TypeAlias = Literal['all', 'online', 'nitro', 'floor'] + +# All available variants. +Variant: TypeAlias = Union[StaticVariant, VirtualVariant] + +# Hash of model IDs for staleness checking. +# Used by postinstall script to detect outdated types. +MODEL_HASH: str = '986e77d89072f654' diff --git a/uv.lock b/uv.lock index c9dcec4..25699b8 100644 --- a/uv.lock +++ b/uv.lock @@ -19,16 +19,17 @@ wheels = [ [[package]] name = "anyio" -version = "4.12.1" +version = "4.11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "idna" }, + { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c6/78/7d432127c41b50bccba979505f272c16cbcadcc33645d5fa3a738110ae75/anyio-4.11.0.tar.gz", hash = "sha256:82a8d0b81e318cc5ce71a5f1f8b5c4e63619620b63141ef8c995fa0db95a57c4", size = 219094, upload-time = "2025-09-23T09:19:12.58Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" }, + { url = "https://files.pythonhosted.org/packages/15/b3/9b1a8074496371342ec1e796a96f99c82c945a339cd81a8e73de28b4cf9e/anyio-4.11.0-py3-none-any.whl", hash = "sha256:0287e96f4d26d4149305414d4e3bc32f0dcd0862365a4bddea19d7a1ec38c4fc", size = 109097, upload-time = "2025-09-23T09:19:10.601Z" }, ] [[package]] @@ -45,11 +46,11 @@ wheels = [ [[package]] name = "certifi" -version = "2026.1.4" +version = "2025.11.12" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e0/2d/a891ca51311197f6ad14a7ef42e2399f36cf2f9bd44752b3dc4eab60fdc5/certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120", size = 154268, upload-time = "2026-01-04T02:42:41.825Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e6/ad/3cc14f097111b4de0040c83a525973216457bbeeb63739ef1ed275c1c021/certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c", size = 152900, upload-time = "2026-01-04T02:42:40.15Z" }, + { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, ] [[package]] @@ -63,23 +64,23 @@ wheels = [ [[package]] name = "dill" -version = "0.4.1" +version = "0.4.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/81/e1/56027a71e31b02ddc53c7d65b01e68edf64dea2932122fe7746a516f75d5/dill-0.4.1.tar.gz", hash = "sha256:423092df4182177d4d8ba8290c8a5b640c66ab35ec7da59ccfa00f6fa3eea5fa", size = 187315, upload-time = "2026-01-19T02:36:56.85Z" } +sdist = { url = "https://files.pythonhosted.org/packages/12/80/630b4b88364e9a8c8c5797f4602d0f76ef820909ee32f0bacb9f90654042/dill-0.4.0.tar.gz", hash = "sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0", size = 186976, upload-time = "2025-04-16T00:41:48.867Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/77/dc8c558f7593132cf8fefec57c4f60c83b16941c574ac5f619abb3ae7933/dill-0.4.1-py3-none-any.whl", hash = "sha256:1e1ce33e978ae97fcfcff5638477032b801c46c7c65cf717f95fbc2248f79a9d", size = 120019, upload-time = "2026-01-19T02:36:55.663Z" }, + { url = "https://files.pythonhosted.org/packages/50/3d/9373ad9c56321fdab5b41197068e1d8c25883b3fea29dd361f9b55116869/dill-0.4.0-py3-none-any.whl", hash = "sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049", size = 119668, upload-time = "2025-04-16T00:41:47.671Z" }, ] [[package]] name = "exceptiongroup" -version = "1.3.1" +version = "1.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, + { url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674, upload-time = "2025-05-10T17:42:49.33Z" }, ] [[package]] @@ -201,16 +202,16 @@ wheels = [ [[package]] name = "nodeenv" -version = "1.10.0" +version = "1.9.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, + { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, ] [[package]] name = "openrouter" -version = "0.1.2" +version = "0.1.3" source = { editable = "." } dependencies = [ { name = "httpcore" }, @@ -253,21 +254,21 @@ wheels = [ [[package]] name = "platformdirs" -version = "4.5.1" +version = "4.5.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.12'", "python_full_version == '3.11.*'", "python_full_version == '3.10.*'", ] -sdist = { url = "https://files.pythonhosted.org/packages/cf/86/0248f086a84f01b37aaec0fa567b397df1a119f73c16f6c7a9aac73ea309/platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda", size = 21715, upload-time = "2025-12-05T13:52:58.638Z" } +sdist = { url = "https://files.pythonhosted.org/packages/61/33/9611380c2bdb1225fdef633e2a9610622310fed35ab11dac9620972ee088/platformdirs-4.5.0.tar.gz", hash = "sha256:70ddccdd7c99fc5942e9fc25636a8b34d04c24b335100223152c2803e4063312", size = 21632, upload-time = "2025-10-08T17:44:48.791Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31", size = 18731, upload-time = "2025-12-05T13:52:56.823Z" }, + { url = "https://files.pythonhosted.org/packages/73/cb/ac7874b3e5d58441674fb70742e6c374b28b0c7cb988d37d991cde47166c/platformdirs-4.5.0-py3-none-any.whl", hash = "sha256:e578a81bb873cbb89a41fcc904c7ef523cc18284b7e3b3ccf06aca1403b7ebd3", size = 18651, upload-time = "2025-10-08T17:44:47.223Z" }, ] [[package]] name = "pydantic" -version = "2.12.5" +version = "2.12.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-types" }, @@ -275,9 +276,9 @@ dependencies = [ { name = "typing-extensions" }, { name = "typing-inspection" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } +sdist = { url = "https://files.pythonhosted.org/packages/96/ad/a17bc283d7d81837c061c49e3eaa27a45991759a1b7eae1031921c6bd924/pydantic-2.12.4.tar.gz", hash = "sha256:0f8cb9555000a4b5b617f66bfd2566264c4984b27589d3b845685983e8ea85ac", size = 821038, upload-time = "2025-11-05T10:50:08.59Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, + { url = "https://files.pythonhosted.org/packages/82/2f/e68750da9b04856e2a7ec56fc6f034a5a79775e9b9a81882252789873798/pydantic-2.12.4-py3-none-any.whl", hash = "sha256:92d3d202a745d46f9be6df459ac5a064fdaa3c1c4cd8adcfa332ccf3c05f871e", size = 463400, upload-time = "2025-11-05T10:50:06.732Z" }, ] [[package]] @@ -422,7 +423,7 @@ dependencies = [ { name = "isort" }, { name = "mccabe" }, { name = "platformdirs", version = "4.4.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, - { name = "platformdirs", version = "4.5.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, + { name = "platformdirs", version = "4.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "tomlkit" }, { name = "typing-extensions", marker = "python_full_version < '3.10'" }, @@ -446,66 +447,70 @@ wheels = [ ] [[package]] -name = "tomli" -version = "2.4.0" +name = "sniffio" +version = "1.3.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" }, - { url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" }, - { url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" }, - { url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" }, - { url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" }, - { url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" }, - { url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" }, - { url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" }, - { url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" }, - { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, - { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, - { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, - { url = "https://files.pythonhosted.org/packages/d2/6d/02ff5ab6c8868b41e7d4b987ce2b5f6a51d3335a70aa144edd999e055a01/tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1", size = 251720, upload-time = "2026-01-11T11:22:00.178Z" }, - { url = "https://files.pythonhosted.org/packages/7b/57/0405c59a909c45d5b6f146107c6d997825aa87568b042042f7a9c0afed34/tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b", size = 247014, upload-time = "2026-01-11T11:22:01.238Z" }, - { url = "https://files.pythonhosted.org/packages/2c/0e/2e37568edd944b4165735687cbaf2fe3648129e440c26d02223672ee0630/tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51", size = 251820, upload-time = "2026-01-11T11:22:02.727Z" }, - { url = "https://files.pythonhosted.org/packages/5a/1c/ee3b707fdac82aeeb92d1a113f803cf6d0f37bdca0849cb489553e1f417a/tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729", size = 97712, upload-time = "2026-01-11T11:22:03.777Z" }, - { url = "https://files.pythonhosted.org/packages/69/13/c07a9177d0b3bab7913299b9278845fc6eaaca14a02667c6be0b0a2270c8/tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da", size = 108296, upload-time = "2026-01-11T11:22:04.86Z" }, - { url = "https://files.pythonhosted.org/packages/18/27/e267a60bbeeee343bcc279bb9e8fbed0cbe224bc7b2a3dc2975f22809a09/tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3", size = 94553, upload-time = "2026-01-11T11:22:05.854Z" }, - { url = "https://files.pythonhosted.org/packages/34/91/7f65f9809f2936e1f4ce6268ae1903074563603b2a2bd969ebbda802744f/tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0", size = 154915, upload-time = "2026-01-11T11:22:06.703Z" }, - { url = "https://files.pythonhosted.org/packages/20/aa/64dd73a5a849c2e8f216b755599c511badde80e91e9bc2271baa7b2cdbb1/tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e", size = 149038, upload-time = "2026-01-11T11:22:07.56Z" }, - { url = "https://files.pythonhosted.org/packages/9e/8a/6d38870bd3d52c8d1505ce054469a73f73a0fe62c0eaf5dddf61447e32fa/tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4", size = 242245, upload-time = "2026-01-11T11:22:08.344Z" }, - { url = "https://files.pythonhosted.org/packages/59/bb/8002fadefb64ab2669e5b977df3f5e444febea60e717e755b38bb7c41029/tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e", size = 250335, upload-time = "2026-01-11T11:22:09.951Z" }, - { url = "https://files.pythonhosted.org/packages/a5/3d/4cdb6f791682b2ea916af2de96121b3cb1284d7c203d97d92d6003e91c8d/tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c", size = 245962, upload-time = "2026-01-11T11:22:11.27Z" }, - { url = "https://files.pythonhosted.org/packages/f2/4a/5f25789f9a460bd858ba9756ff52d0830d825b458e13f754952dd15fb7bb/tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f", size = 250396, upload-time = "2026-01-11T11:22:12.325Z" }, - { url = "https://files.pythonhosted.org/packages/aa/2f/b73a36fea58dfa08e8b3a268750e6853a6aac2a349241a905ebd86f3047a/tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86", size = 97530, upload-time = "2026-01-11T11:22:13.865Z" }, - { url = "https://files.pythonhosted.org/packages/3b/af/ca18c134b5d75de7e8dc551c5234eaba2e8e951f6b30139599b53de9c187/tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87", size = 108227, upload-time = "2026-01-11T11:22:15.224Z" }, - { url = "https://files.pythonhosted.org/packages/22/c3/b386b832f209fee8073c8138ec50f27b4460db2fdae9ffe022df89a57f9b/tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132", size = 94748, upload-time = "2026-01-11T11:22:16.009Z" }, - { url = "https://files.pythonhosted.org/packages/f3/c4/84047a97eb1004418bc10bdbcfebda209fca6338002eba2dc27cc6d13563/tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6", size = 154725, upload-time = "2026-01-11T11:22:17.269Z" }, - { url = "https://files.pythonhosted.org/packages/a8/5d/d39038e646060b9d76274078cddf146ced86dc2b9e8bbf737ad5983609a0/tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc", size = 148901, upload-time = "2026-01-11T11:22:18.287Z" }, - { url = "https://files.pythonhosted.org/packages/73/e5/383be1724cb30f4ce44983d249645684a48c435e1cd4f8b5cded8a816d3c/tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66", size = 243375, upload-time = "2026-01-11T11:22:19.154Z" }, - { url = "https://files.pythonhosted.org/packages/31/f0/bea80c17971c8d16d3cc109dc3585b0f2ce1036b5f4a8a183789023574f2/tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d", size = 250639, upload-time = "2026-01-11T11:22:20.168Z" }, - { url = "https://files.pythonhosted.org/packages/2c/8f/2853c36abbb7608e3f945d8a74e32ed3a74ee3a1f468f1ffc7d1cb3abba6/tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702", size = 246897, upload-time = "2026-01-11T11:22:21.544Z" }, - { url = "https://files.pythonhosted.org/packages/49/f0/6c05e3196ed5337b9fe7ea003e95fd3819a840b7a0f2bf5a408ef1dad8ed/tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8", size = 254697, upload-time = "2026-01-11T11:22:23.058Z" }, - { url = "https://files.pythonhosted.org/packages/f3/f5/2922ef29c9f2951883525def7429967fc4d8208494e5ab524234f06b688b/tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776", size = 98567, upload-time = "2026-01-11T11:22:24.033Z" }, - { url = "https://files.pythonhosted.org/packages/7b/31/22b52e2e06dd2a5fdbc3ee73226d763b184ff21fc24e20316a44ccc4d96b/tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475", size = 108556, upload-time = "2026-01-11T11:22:25.378Z" }, - { url = "https://files.pythonhosted.org/packages/48/3d/5058dff3255a3d01b705413f64f4306a141a8fd7a251e5a495e3f192a998/tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2", size = 96014, upload-time = "2026-01-11T11:22:26.138Z" }, - { url = "https://files.pythonhosted.org/packages/b8/4e/75dab8586e268424202d3a1997ef6014919c941b50642a1682df43204c22/tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9", size = 163339, upload-time = "2026-01-11T11:22:27.143Z" }, - { url = "https://files.pythonhosted.org/packages/06/e3/b904d9ab1016829a776d97f163f183a48be6a4deb87304d1e0116a349519/tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0", size = 159490, upload-time = "2026-01-11T11:22:28.399Z" }, - { url = "https://files.pythonhosted.org/packages/e3/5a/fc3622c8b1ad823e8ea98a35e3c632ee316d48f66f80f9708ceb4f2a0322/tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df", size = 269398, upload-time = "2026-01-11T11:22:29.345Z" }, - { url = "https://files.pythonhosted.org/packages/fd/33/62bd6152c8bdd4c305ad9faca48f51d3acb2df1f8791b1477d46ff86e7f8/tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d", size = 276515, upload-time = "2026-01-11T11:22:30.327Z" }, - { url = "https://files.pythonhosted.org/packages/4b/ff/ae53619499f5235ee4211e62a8d7982ba9e439a0fb4f2f351a93d67c1dd2/tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f", size = 273806, upload-time = "2026-01-11T11:22:32.56Z" }, - { url = "https://files.pythonhosted.org/packages/47/71/cbca7787fa68d4d0a9f7072821980b39fbb1b6faeb5f5cf02f4a5559fa28/tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b", size = 281340, upload-time = "2026-01-11T11:22:33.505Z" }, - { url = "https://files.pythonhosted.org/packages/f5/00/d595c120963ad42474cf6ee7771ad0d0e8a49d0f01e29576ee9195d9ecdf/tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087", size = 108106, upload-time = "2026-01-11T11:22:34.451Z" }, - { url = "https://files.pythonhosted.org/packages/de/69/9aa0c6a505c2f80e519b43764f8b4ba93b5a0bbd2d9a9de6e2b24271b9a5/tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd", size = 120504, upload-time = "2026-01-11T11:22:35.764Z" }, - { url = "https://files.pythonhosted.org/packages/b3/9f/f1668c281c58cfae01482f7114a4b88d345e4c140386241a1a24dcc9e7bc/tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4", size = 99561, upload-time = "2026-01-11T11:22:36.624Z" }, - { url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" }, + { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, +] + +[[package]] +name = "tomli" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, + { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, + { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, + { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, + { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, + { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, + { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, + { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, + { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, + { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, + { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, + { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, + { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, + { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, + { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, + { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, + { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, + { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, + { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, + { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, + { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, + { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, + { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, + { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, + { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, ] [[package]] name = "tomlkit" -version = "0.14.0" +version = "0.13.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c3/af/14b24e41977adb296d6bd1fb59402cf7d60ce364f90c890bd2ec65c43b5a/tomlkit-0.14.0.tar.gz", hash = "sha256:cf00efca415dbd57575befb1f6634c4f42d2d87dbba376128adb42c121b87064", size = 187167, upload-time = "2026-01-13T01:14:53.304Z" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/18/0bbf3884e9eaa38819ebe46a7bd25dcd56b67434402b66a58c4b8e552575/tomlkit-0.13.3.tar.gz", hash = "sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1", size = 185207, upload-time = "2025-06-05T07:13:44.947Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" }, + { url = "https://files.pythonhosted.org/packages/bd/75/8539d011f6be8e29f339c42e633aae3cb73bffa95dd0f9adec09b9c58e85/tomlkit-0.13.3-py3-none-any.whl", hash = "sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0", size = 38901, upload-time = "2025-06-05T07:13:43.546Z" }, ] [[package]]