mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9193488c2b |
+55
-3
@@ -1,12 +1,12 @@
|
||||
lockVersion: 2.0.0
|
||||
id: cfd52247-6a25-4c6d-bbce-fe6fce0cd69d
|
||||
management:
|
||||
docChecksum: 4cc0fd0666832ffd4990d56ea4d60d8a
|
||||
docChecksum: 86bc0c01844e23d7e1921008d13372b9
|
||||
docVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
generationVersion: 2.768.0
|
||||
releaseVersion: 0.4.1
|
||||
configChecksum: 25abf1229cf681cc15488099121619e5
|
||||
releaseVersion: 0.5.1
|
||||
configChecksum: 7f34271a911f5490f6f17a4e27f8ef7f
|
||||
repoURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
installationURL: https://github.com/OpenRouterTeam/python-sdk.git
|
||||
published: true
|
||||
@@ -498,15 +498,19 @@ generatedFiles:
|
||||
- docs/models/internal/globals.md
|
||||
- docs/models/utils/retryconfig.md
|
||||
- docs/operations/apitype.md
|
||||
- docs/operations/bulkassignkeystoguardrailglobals.md
|
||||
- docs/operations/bulkassignkeystoguardrailrequest.md
|
||||
- docs/operations/bulkassignkeystoguardrailrequestbody.md
|
||||
- docs/operations/bulkassignkeystoguardrailresponse.md
|
||||
- docs/operations/bulkassignmemberstoguardrailglobals.md
|
||||
- docs/operations/bulkassignmemberstoguardrailrequest.md
|
||||
- docs/operations/bulkassignmemberstoguardrailrequestbody.md
|
||||
- docs/operations/bulkassignmemberstoguardrailresponse.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailglobals.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailrequest.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailrequestbody.md
|
||||
- docs/operations/bulkunassignkeysfromguardrailresponse.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailglobals.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailrequest.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailrequestbody.md
|
||||
- docs/operations/bulkunassignmembersfromguardrailresponse.md
|
||||
@@ -517,77 +521,119 @@ generatedFiles:
|
||||
- docs/operations/contenttext.md
|
||||
- docs/operations/createauthkeyscodecodechallengemethod.md
|
||||
- docs/operations/createauthkeyscodedata.md
|
||||
- docs/operations/createauthkeyscodeglobals.md
|
||||
- docs/operations/createauthkeyscoderequest.md
|
||||
- docs/operations/createauthkeyscoderequestbody.md
|
||||
- docs/operations/createauthkeyscoderesponse.md
|
||||
- docs/operations/createcoinbasechargedata.md
|
||||
- docs/operations/createcoinbasechargeglobals.md
|
||||
- docs/operations/createcoinbasechargerequest.md
|
||||
- docs/operations/createcoinbasechargeresponse.md
|
||||
- docs/operations/createcoinbasechargesecurity.md
|
||||
- docs/operations/createembeddingsdata.md
|
||||
- docs/operations/createembeddingsglobals.md
|
||||
- docs/operations/createembeddingsrequest.md
|
||||
- docs/operations/createembeddingsrequestbody.md
|
||||
- docs/operations/createembeddingsresponse.md
|
||||
- docs/operations/createembeddingsresponsebody.md
|
||||
- docs/operations/createguardraildata.md
|
||||
- docs/operations/createguardrailglobals.md
|
||||
- docs/operations/createguardrailrequest.md
|
||||
- docs/operations/createguardrailrequestbody.md
|
||||
- docs/operations/createguardrailresetintervalrequest.md
|
||||
- docs/operations/createguardrailresetintervalresponse.md
|
||||
- docs/operations/createguardrailresponse.md
|
||||
- docs/operations/createkeysdata.md
|
||||
- docs/operations/createkeysglobals.md
|
||||
- docs/operations/createkeyslimitreset.md
|
||||
- docs/operations/createkeysrequest.md
|
||||
- docs/operations/createkeysrequestbody.md
|
||||
- docs/operations/createkeysresponse.md
|
||||
- docs/operations/createresponsesglobals.md
|
||||
- docs/operations/createresponsesrequest.md
|
||||
- docs/operations/createresponsesresponse.md
|
||||
- docs/operations/createresponsesresponsebody.md
|
||||
- docs/operations/deleteguardrailglobals.md
|
||||
- docs/operations/deleteguardrailrequest.md
|
||||
- docs/operations/deleteguardrailresponse.md
|
||||
- docs/operations/deletekeysglobals.md
|
||||
- docs/operations/deletekeysrequest.md
|
||||
- docs/operations/deletekeysresponse.md
|
||||
- docs/operations/embedding.md
|
||||
- docs/operations/encodingformat.md
|
||||
- docs/operations/exchangeauthcodeforapikeycodechallengemethod.md
|
||||
- docs/operations/exchangeauthcodeforapikeyglobals.md
|
||||
- docs/operations/exchangeauthcodeforapikeyrequest.md
|
||||
- docs/operations/exchangeauthcodeforapikeyrequestbody.md
|
||||
- docs/operations/exchangeauthcodeforapikeyresponse.md
|
||||
- docs/operations/getcreditsdata.md
|
||||
- docs/operations/getcreditsglobals.md
|
||||
- docs/operations/getcreditsrequest.md
|
||||
- docs/operations/getcreditsresponse.md
|
||||
- docs/operations/getcurrentkeydata.md
|
||||
- docs/operations/getcurrentkeyglobals.md
|
||||
- docs/operations/getcurrentkeyrequest.md
|
||||
- docs/operations/getcurrentkeyresponse.md
|
||||
- docs/operations/getgenerationdata.md
|
||||
- docs/operations/getgenerationglobals.md
|
||||
- docs/operations/getgenerationrequest.md
|
||||
- docs/operations/getgenerationresponse.md
|
||||
- docs/operations/getguardraildata.md
|
||||
- docs/operations/getguardrailglobals.md
|
||||
- docs/operations/getguardrailrequest.md
|
||||
- docs/operations/getguardrailresetinterval.md
|
||||
- docs/operations/getguardrailresponse.md
|
||||
- docs/operations/getkeydata.md
|
||||
- docs/operations/getkeyglobals.md
|
||||
- docs/operations/getkeyrequest.md
|
||||
- docs/operations/getkeyresponse.md
|
||||
- docs/operations/getmodelsglobals.md
|
||||
- docs/operations/getmodelsrequest.md
|
||||
- docs/operations/getuseractivityglobals.md
|
||||
- docs/operations/getuseractivityrequest.md
|
||||
- docs/operations/getuseractivityresponse.md
|
||||
- docs/operations/imageurl.md
|
||||
- docs/operations/input.md
|
||||
- docs/operations/inputunion.md
|
||||
- docs/operations/listdata.md
|
||||
- docs/operations/listembeddingsmodelsglobals.md
|
||||
- docs/operations/listembeddingsmodelsrequest.md
|
||||
- docs/operations/listendpointsglobals.md
|
||||
- docs/operations/listendpointsrequest.md
|
||||
- docs/operations/listendpointsresponse.md
|
||||
- docs/operations/listendpointszdrglobals.md
|
||||
- docs/operations/listendpointszdrrequest.md
|
||||
- docs/operations/listendpointszdrresponse.md
|
||||
- docs/operations/listglobals.md
|
||||
- docs/operations/listguardrailkeyassignmentsdata.md
|
||||
- docs/operations/listguardrailkeyassignmentsglobals.md
|
||||
- docs/operations/listguardrailkeyassignmentsrequest.md
|
||||
- docs/operations/listguardrailkeyassignmentsresponse.md
|
||||
- docs/operations/listguardrailmemberassignmentsdata.md
|
||||
- docs/operations/listguardrailmemberassignmentsglobals.md
|
||||
- docs/operations/listguardrailmemberassignmentsrequest.md
|
||||
- docs/operations/listguardrailmemberassignmentsresponse.md
|
||||
- docs/operations/listguardrailsdata.md
|
||||
- docs/operations/listguardrailsglobals.md
|
||||
- docs/operations/listguardrailsrequest.md
|
||||
- docs/operations/listguardrailsresetinterval.md
|
||||
- docs/operations/listguardrailsresponse.md
|
||||
- docs/operations/listkeyassignmentsdata.md
|
||||
- docs/operations/listkeyassignmentsglobals.md
|
||||
- docs/operations/listkeyassignmentsrequest.md
|
||||
- docs/operations/listkeyassignmentsresponse.md
|
||||
- docs/operations/listmemberassignmentsdata.md
|
||||
- docs/operations/listmemberassignmentsglobals.md
|
||||
- docs/operations/listmemberassignmentsrequest.md
|
||||
- docs/operations/listmemberassignmentsresponse.md
|
||||
- docs/operations/listmodelscountglobals.md
|
||||
- docs/operations/listmodelscountrequest.md
|
||||
- docs/operations/listmodelsuserglobals.md
|
||||
- docs/operations/listmodelsuserrequest.md
|
||||
- docs/operations/listmodelsusersecurity.md
|
||||
- docs/operations/listprovidersdata.md
|
||||
- docs/operations/listprovidersglobals.md
|
||||
- docs/operations/listprovidersrequest.md
|
||||
- docs/operations/listprovidersresponse.md
|
||||
- docs/operations/listrequest.md
|
||||
- docs/operations/listresponse.md
|
||||
@@ -597,17 +643,21 @@ generatedFiles:
|
||||
- docs/operations/providername.md
|
||||
- docs/operations/providerresponse.md
|
||||
- docs/operations/ratelimit.md
|
||||
- docs/operations/sendchatcompletionrequestglobals.md
|
||||
- docs/operations/sendchatcompletionrequestrequest.md
|
||||
- docs/operations/sendchatcompletionrequestresponse.md
|
||||
- docs/operations/transferintent.md
|
||||
- docs/operations/typeimageurl.md
|
||||
- docs/operations/typetext.md
|
||||
- docs/operations/updateguardraildata.md
|
||||
- docs/operations/updateguardrailglobals.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/updatekeysglobals.md
|
||||
- docs/operations/updatekeyslimitreset.md
|
||||
- docs/operations/updatekeysrequest.md
|
||||
- docs/operations/updatekeysrequestbody.md
|
||||
@@ -852,6 +902,7 @@ generatedFiles:
|
||||
- src/openrouter/operations/getmodels.py
|
||||
- src/openrouter/operations/getuseractivity.py
|
||||
- src/openrouter/operations/list.py
|
||||
- src/openrouter/operations/listembeddingsmodels.py
|
||||
- src/openrouter/operations/listendpoints.py
|
||||
- src/openrouter/operations/listendpointszdr.py
|
||||
- src/openrouter/operations/listguardrailkeyassignments.py
|
||||
@@ -859,6 +910,7 @@ generatedFiles:
|
||||
- src/openrouter/operations/listguardrails.py
|
||||
- src/openrouter/operations/listkeyassignments.py
|
||||
- src/openrouter/operations/listmemberassignments.py
|
||||
- src/openrouter/operations/listmodelscount.py
|
||||
- src/openrouter/operations/listmodelsuser.py
|
||||
- src/openrouter/operations/listproviders.py
|
||||
- src/openrouter/operations/sendchatcompletionrequest.py
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ generation:
|
||||
skipResponseBodyAssertions: false
|
||||
preApplyUnionDiscriminators: true
|
||||
python:
|
||||
version: 0.4.1
|
||||
version: 0.5.1
|
||||
additionalDependencies:
|
||||
dev: {}
|
||||
main: {}
|
||||
|
||||
@@ -4403,7 +4403,6 @@ components:
|
||||
- tool_use
|
||||
- pause_turn
|
||||
- refusal
|
||||
- model_context_window_exceeded
|
||||
stop_sequence:
|
||||
type: string
|
||||
nullable: true
|
||||
@@ -4431,6 +4430,9 @@ components:
|
||||
required:
|
||||
- ephemeral_5m_input_tokens
|
||||
- ephemeral_1h_input_tokens
|
||||
inference_geo:
|
||||
type: string
|
||||
nullable: true
|
||||
server_tool_use:
|
||||
type: object
|
||||
nullable: true
|
||||
@@ -4452,6 +4454,7 @@ components:
|
||||
- cache_creation_input_tokens
|
||||
- cache_read_input_tokens
|
||||
- cache_creation
|
||||
- inference_geo
|
||||
- server_tool_use
|
||||
- service_tier
|
||||
required:
|
||||
@@ -4486,6 +4489,7 @@ components:
|
||||
cache_creation_input_tokens: null
|
||||
cache_read_input_tokens: null
|
||||
cache_creation: null
|
||||
inference_geo: null
|
||||
server_tool_use: null
|
||||
service_tier: standard
|
||||
AnthropicMessagesStreamEvent:
|
||||
@@ -4805,6 +4809,9 @@ components:
|
||||
required:
|
||||
- ephemeral_5m_input_tokens
|
||||
- ephemeral_1h_input_tokens
|
||||
inference_geo:
|
||||
type: string
|
||||
nullable: true
|
||||
server_tool_use:
|
||||
type: object
|
||||
nullable: true
|
||||
@@ -4826,6 +4833,7 @@ components:
|
||||
- cache_creation_input_tokens
|
||||
- cache_read_input_tokens
|
||||
- cache_creation
|
||||
- inference_geo
|
||||
- server_tool_use
|
||||
- service_tier
|
||||
required:
|
||||
@@ -4859,7 +4867,6 @@ components:
|
||||
- tool_use
|
||||
- pause_turn
|
||||
- refusal
|
||||
- model_context_window_exceeded
|
||||
stop_sequence:
|
||||
type: string
|
||||
nullable: true
|
||||
@@ -6524,6 +6531,22 @@ components:
|
||||
- role
|
||||
- content
|
||||
description: Anthropic message with OpenRouter extensions
|
||||
AnthropicOutputConfig:
|
||||
type: object
|
||||
properties:
|
||||
effort:
|
||||
type: string
|
||||
nullable: true
|
||||
enum:
|
||||
- low
|
||||
- medium
|
||||
- high
|
||||
- max
|
||||
description: >-
|
||||
How much effort the model should put into its response. Higher effort levels may result in more thorough
|
||||
analysis but take longer. Valid values are `low`, `medium`, `high`, or `max`.
|
||||
example: medium
|
||||
description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5.
|
||||
AnthropicMessagesRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -6937,6 +6960,14 @@ components:
|
||||
- disabled
|
||||
required:
|
||||
- type
|
||||
- type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- adaptive
|
||||
required:
|
||||
- type
|
||||
service_tier:
|
||||
type: string
|
||||
enum:
|
||||
@@ -7164,6 +7195,8 @@ components:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
output_config:
|
||||
$ref: '#/components/schemas/AnthropicOutputConfig'
|
||||
required:
|
||||
- model
|
||||
- max_tokens
|
||||
|
||||
+119
-2
@@ -4407,7 +4407,6 @@ components:
|
||||
- tool_use
|
||||
- pause_turn
|
||||
- refusal
|
||||
- model_context_window_exceeded
|
||||
x-speakeasy-unknown-values: allow
|
||||
stop_sequence:
|
||||
type: string
|
||||
@@ -4436,6 +4435,9 @@ components:
|
||||
required:
|
||||
- ephemeral_5m_input_tokens
|
||||
- ephemeral_1h_input_tokens
|
||||
inference_geo:
|
||||
type: string
|
||||
nullable: true
|
||||
server_tool_use:
|
||||
type: object
|
||||
nullable: true
|
||||
@@ -4458,6 +4460,7 @@ components:
|
||||
- cache_creation_input_tokens
|
||||
- cache_read_input_tokens
|
||||
- cache_creation
|
||||
- inference_geo
|
||||
- server_tool_use
|
||||
- service_tier
|
||||
required:
|
||||
@@ -4492,6 +4495,7 @@ components:
|
||||
cache_creation_input_tokens: null
|
||||
cache_read_input_tokens: null
|
||||
cache_creation: null
|
||||
inference_geo: null
|
||||
server_tool_use: null
|
||||
service_tier: standard
|
||||
AnthropicMessagesStreamEvent:
|
||||
@@ -4812,6 +4816,9 @@ components:
|
||||
required:
|
||||
- ephemeral_5m_input_tokens
|
||||
- ephemeral_1h_input_tokens
|
||||
inference_geo:
|
||||
type: string
|
||||
nullable: true
|
||||
server_tool_use:
|
||||
type: object
|
||||
nullable: true
|
||||
@@ -4834,6 +4841,7 @@ components:
|
||||
- cache_creation_input_tokens
|
||||
- cache_read_input_tokens
|
||||
- cache_creation
|
||||
- inference_geo
|
||||
- server_tool_use
|
||||
- service_tier
|
||||
required:
|
||||
@@ -4867,7 +4875,6 @@ components:
|
||||
- tool_use
|
||||
- pause_turn
|
||||
- refusal
|
||||
- model_context_window_exceeded
|
||||
x-speakeasy-unknown-values: allow
|
||||
stop_sequence:
|
||||
type: string
|
||||
@@ -6552,6 +6559,22 @@ components:
|
||||
- role
|
||||
- content
|
||||
description: Anthropic message with OpenRouter extensions
|
||||
AnthropicOutputConfig:
|
||||
type: object
|
||||
properties:
|
||||
effort:
|
||||
type: string
|
||||
nullable: true
|
||||
enum:
|
||||
- low
|
||||
- medium
|
||||
- high
|
||||
- max
|
||||
description: >-
|
||||
How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer. Valid values are `low`, `medium`, `high`, or `max`.
|
||||
example: medium
|
||||
x-speakeasy-unknown-values: allow
|
||||
description: Configuration for controlling output behavior. Currently supports the effort parameter for Claude Opus 4.5.
|
||||
AnthropicMessagesRequest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -6970,6 +6993,14 @@ components:
|
||||
- disabled
|
||||
required:
|
||||
- type
|
||||
- type: object
|
||||
properties:
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- adaptive
|
||||
required:
|
||||
- type
|
||||
service_tier:
|
||||
type: string
|
||||
enum:
|
||||
@@ -7182,6 +7213,8 @@ components:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
output_config:
|
||||
$ref: '#/components/schemas/AnthropicOutputConfig'
|
||||
required:
|
||||
- model
|
||||
- max_tokens
|
||||
@@ -9562,6 +9595,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
||||
operationId: createResponses
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/messages:
|
||||
post:
|
||||
x-speakeasy-ignore: true
|
||||
@@ -9790,6 +9826,9 @@ paths:
|
||||
- type
|
||||
- error
|
||||
operationId: createMessages
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/activity:
|
||||
get:
|
||||
tags:
|
||||
@@ -9859,6 +9898,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/credits:
|
||||
get:
|
||||
x-speakeasy-name-override: getCredits
|
||||
@@ -9918,6 +9960,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/credits/coinbase:
|
||||
post:
|
||||
security:
|
||||
@@ -10040,6 +10085,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/embeddings:
|
||||
post:
|
||||
x-speakeasy-name-override: generate
|
||||
@@ -10244,6 +10292,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
||||
operationId: createEmbeddings
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/embeddings/models:
|
||||
get:
|
||||
tags:
|
||||
@@ -10271,6 +10322,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: listEmbeddingsModels
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/generation:
|
||||
get:
|
||||
tags:
|
||||
@@ -10669,6 +10723,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
||||
operationId: getGeneration
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/models/count:
|
||||
get:
|
||||
tags:
|
||||
@@ -10689,6 +10746,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: listModelsCount
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/models:
|
||||
get:
|
||||
tags:
|
||||
@@ -10743,6 +10803,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: getModels
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/models/user:
|
||||
get:
|
||||
tags:
|
||||
@@ -10779,6 +10842,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: listModelsUser
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/models/{author}/{slug}/endpoints:
|
||||
get:
|
||||
tags:
|
||||
@@ -10821,6 +10887,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/endpoints/zdr:
|
||||
get:
|
||||
tags:
|
||||
@@ -10848,6 +10917,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: listEndpointsZdr
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/providers:
|
||||
get:
|
||||
tags:
|
||||
@@ -10909,6 +10981,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/keys:
|
||||
get:
|
||||
operationId: list
|
||||
@@ -11352,6 +11427,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: createKeys
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/keys/{hash}:
|
||||
patch:
|
||||
x-speakeasy-name-override: update
|
||||
@@ -11849,6 +11927,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails:
|
||||
get:
|
||||
operationId: listGuardrails
|
||||
@@ -12221,6 +12302,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/{id}:
|
||||
get:
|
||||
operationId: getGuardrail
|
||||
@@ -12638,6 +12722,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/assignments/keys:
|
||||
get:
|
||||
operationId: listKeyAssignments
|
||||
@@ -12736,6 +12823,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/assignments/members:
|
||||
get:
|
||||
operationId: listMemberAssignments
|
||||
@@ -12829,6 +12919,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/{id}/assignments/keys:
|
||||
get:
|
||||
operationId: listGuardrailKeyAssignments
|
||||
@@ -13016,6 +13109,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/{id}/assignments/members:
|
||||
get:
|
||||
operationId: listGuardrailMemberAssignments
|
||||
@@ -13199,6 +13295,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/{id}/assignments/keys/remove:
|
||||
post:
|
||||
operationId: bulkUnassignKeysFromGuardrail
|
||||
@@ -13274,6 +13373,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/guardrails/{id}/assignments/members/remove:
|
||||
post:
|
||||
operationId: bulkUnassignMembersFromGuardrail
|
||||
@@ -13350,6 +13452,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/key:
|
||||
get:
|
||||
operationId: getCurrentKey
|
||||
@@ -13538,6 +13643,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/auth/keys:
|
||||
post:
|
||||
operationId: exchangeAuthCodeForAPIKey
|
||||
@@ -13616,6 +13724,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/auth/keys/code:
|
||||
post:
|
||||
x-speakeasy-name-override: createAuthCode
|
||||
@@ -13717,6 +13828,9 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/InternalServerResponse'
|
||||
operationId: createAuthKeysCode
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
/chat/completions:
|
||||
post:
|
||||
summary: Create a chat completion
|
||||
@@ -13771,6 +13885,9 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ChatError'
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
servers:
|
||||
- url: https://openrouter.ai/api/v1
|
||||
description: Production server
|
||||
|
||||
@@ -33,3 +33,11 @@ actions:
|
||||
type: string
|
||||
description: |
|
||||
The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
# Add header parameters to all paths so Speakeasy matches them with globals
|
||||
- target: $.paths[*]
|
||||
description: Reference app identification headers on all paths so Speakeasy injects them via globals
|
||||
update:
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/AppIdentifier"
|
||||
- $ref: "#/components/parameters/AppDisplayName"
|
||||
|
||||
@@ -8,8 +8,8 @@ sources:
|
||||
- latest
|
||||
OpenRouter API:
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:081a51121f970e44311f1415c10c22b1838d1d1b6057280a3e6cba78acab1dca
|
||||
sourceBlobDigest: sha256:fc6bdfffd4edd78b043363b817794d80faaa927b5b4b7e8f149fda68084dac13
|
||||
sourceRevisionDigest: sha256:9d0580abfbe319bbd1e3d51fa921b5c97134ae4ef84ee4b1254beb0e92bf4fd9
|
||||
sourceBlobDigest: sha256:8555ff45ab0e3c22ae07af40cc4581ef14107b4d62c38bde3c25512fd4aae199
|
||||
tags:
|
||||
- latest
|
||||
- main
|
||||
@@ -18,10 +18,10 @@ targets:
|
||||
open-router:
|
||||
source: OpenRouter API
|
||||
sourceNamespace: open-router-chat-completions-api
|
||||
sourceRevisionDigest: sha256:081a51121f970e44311f1415c10c22b1838d1d1b6057280a3e6cba78acab1dca
|
||||
sourceBlobDigest: sha256:fc6bdfffd4edd78b043363b817794d80faaa927b5b4b7e8f149fda68084dac13
|
||||
sourceRevisionDigest: sha256:9d0580abfbe319bbd1e3d51fa921b5c97134ae4ef84ee4b1254beb0e92bf4fd9
|
||||
sourceBlobDigest: sha256:8555ff45ab0e3c22ae07af40cc4581ef14107b4d62c38bde3c25512fd4aae199
|
||||
codeSamplesNamespace: open-router-python-code-samples
|
||||
codeSamplesRevisionDigest: sha256:c48795939148c825d881d736e1b7a8d884b6b7e3f66114a5e11d4ed532b75baa
|
||||
codeSamplesRevisionDigest: sha256:e44fdec134bc5f249b3e785da067ea31d1bba8f9891bca0f6c19d7ace670ab11
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
speakeasyVersion: 1.666.0
|
||||
|
||||
@@ -182,6 +182,8 @@ import os
|
||||
def main():
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
@@ -191,6 +193,8 @@ def main():
|
||||
async def amain():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
# Rest of application here...
|
||||
|
||||
@@ -6,6 +6,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -30,6 +32,8 @@ import os
|
||||
async def main():
|
||||
|
||||
async with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# BulkAssignKeysToGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# BulkAssignMembersToGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# BulkUnassignKeysFromGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# BulkUnassignMembersFromGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateAuthKeysCodeGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,10 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||
| `callback_url` | *str* | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback |
|
||||
| `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM |
|
||||
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `request_body` | [operations.CreateAuthKeysCodeRequestBody](../operations/createauthkeyscoderequestbody.md) | :heavy_check_mark: | N/A | {<br/>"callback_url": "https://myapp.com/auth/callback",<br/>"code_challenge": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",<br/>"code_challenge_method": "S256",<br/>"limit": 100<br/>} |
|
||||
@@ -0,0 +1,12 @@
|
||||
# CreateAuthKeysCodeRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
||||
| `callback_url` | *str* | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback |
|
||||
| `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM |
|
||||
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateCoinbaseChargeGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,10 @@
|
||||
# CreateCoinbaseChargeRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `create_charge_request` | [components.CreateChargeRequest](../components/createchargerequest.md) | :heavy_check_mark: | N/A | {<br/>"amount": 100,<br/>"sender": "0x1234567890123456789012345678901234567890",<br/>"chain_id": 1<br/>} |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateEmbeddingsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,12 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
||||
| `input` | [operations.InputUnion](../operations/inputunion.md) | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `encoding_format` | [Optional[operations.EncodingFormat]](../operations/encodingformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `provider` | [Optional[components.ProviderPreferences]](../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. |
|
||||
| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `request_body` | [operations.CreateEmbeddingsRequestBody](../operations/createembeddingsrequestbody.md) | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,14 @@
|
||||
# CreateEmbeddingsRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
||||
| `input` | [operations.InputUnion](../operations/inputunion.md) | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `encoding_format` | [Optional[operations.EncodingFormat]](../operations/encodingformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `provider` | [Optional[components.ProviderPreferences]](../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. |
|
||||
| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,12 +3,8 @@
|
||||
|
||||
## 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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2",<br/>"anthropic/claude-4.5-opus-20251124",<br/>"deepseek/deepseek-r1-0528:free"<br/>] |
|
||||
| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `request_body` | [operations.CreateGuardrailRequestBody](../operations/createguardrailrequestbody.md) | :heavy_check_mark: | N/A | {<br/>"name": "My New Guardrail",<br/>"description": "A guardrail for limiting API usage",<br/>"limit_usd": 50,<br/>"reset_interval": "monthly",<br/>"allowed_providers": [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>],<br/>"allowed_models": null,<br/>"enforce_zdr": false<br/>} |
|
||||
@@ -0,0 +1,14 @@
|
||||
# CreateGuardrailRequestBody
|
||||
|
||||
|
||||
## 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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2",<br/>"anthropic/claude-4.5-opus-20251124",<br/>"deepseek/deepseek-r1-0528:free"<br/>] |
|
||||
| `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to enforce zero data retention | false |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateKeysGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,10 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key |
|
||||
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
|
||||
| `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../operations/createkeyslimitreset.md) | :heavy_minus_sign: | 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. | monthly |
|
||||
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `request_body` | [operations.CreateKeysRequestBody](../operations/createkeysrequestbody.md) | :heavy_check_mark: | N/A | {<br/>"name": "My New API Key",<br/>"limit": 50,<br/>"limit_reset": "monthly",<br/>"include_byok_in_limit": true,<br/>"expires_at": "2027-12-31T23:59:59Z"<br/>} |
|
||||
@@ -0,0 +1,12 @@
|
||||
# CreateKeysRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key |
|
||||
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
|
||||
| `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../operations/createkeyslimitreset.md) | :heavy_minus_sign: | 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. | monthly |
|
||||
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be rejected | 2027-12-31T23:59:59Z |
|
||||
@@ -0,0 +1,9 @@
|
||||
# CreateResponsesGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,10 @@
|
||||
# CreateResponsesRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `open_responses_request` | [components.OpenResponsesRequest](../components/openresponsesrequest.md) | :heavy_check_mark: | N/A | {<br/>"model": "anthropic/claude-4.5-sonnet-20250929",<br/>"input": [<br/>{<br/>"type": "message",<br/>"content": "Hello, how are you?",<br/>"role": "user"<br/>}<br/>],<br/>"temperature": 0.7,<br/>"top_p": 0.9,<br/>"tools": [<br/>{<br/>"type": "function",<br/>"name": "get_current_weather",<br/>"description": "Get the current weather in a given location",<br/>"parameters": {<br/>"type": "object",<br/>"properties": {<br/>"location": {<br/>"type": "string"<br/>}<br/>}<br/>}<br/>}<br/>]<br/>} |
|
||||
@@ -0,0 +1,9 @@
|
||||
# DeleteGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# DeleteKeysGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ExchangeAuthCodeForAPIKeyGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 |
|
||||
| `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk |
|
||||
| `code_challenge_method` | [OptionalNullable[operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../operations/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `request_body` | [operations.ExchangeAuthCodeForAPIKeyRequestBody](../operations/exchangeauthcodeforapikeyrequestbody.md) | :heavy_check_mark: | N/A | {<br/>"code": "auth_code_abc123def456",<br/>"code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk",<br/>"code_challenge_method": "S256"<br/>} |
|
||||
@@ -0,0 +1,10 @@
|
||||
# ExchangeAuthCodeForAPIKeyRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 |
|
||||
| `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk |
|
||||
| `code_challenge_method` | [OptionalNullable[operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../operations/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetCreditsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetCreditsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetCurrentKeyGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetCurrentKeyRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetGenerationGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetKeyGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetModelsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| 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 | |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | |
|
||||
@@ -0,0 +1,9 @@
|
||||
# GetUserActivityGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||
| `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListEmbeddingsModelsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListEmbeddingsModelsRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListEndpointsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| `author` | *str* | :heavy_check_mark: | N/A |
|
||||
| `slug` | *str* | :heavy_check_mark: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `author` | *str* | :heavy_check_mark: | N/A |
|
||||
| `slug` | *str* | :heavy_check_mark: | N/A |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListEndpointsZdrGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListEndpointsZdrRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListGuardrailKeyAssignmentsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,8 +3,10 @@
|
||||
|
||||
## 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 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListGuardrailMemberAssignmentsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,8 +3,10 @@
|
||||
|
||||
## 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 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListGuardrailsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListKeyAssignmentsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListMemberAssignmentsGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListModelsCountGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListModelsCountRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListModelsUserGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListModelsUserRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListProvidersGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,9 @@
|
||||
# ListProvidersRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
|
||||
| `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false |
|
||||
| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false |
|
||||
| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 |
|
||||
@@ -0,0 +1,9 @@
|
||||
# SendChatCompletionRequestGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -0,0 +1,10 @@
|
||||
# SendChatCompletionRequestRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `chat_generation_params` | [components.ChatGenerationParams](../components/chatgenerationparams.md) | :heavy_check_mark: | Chat completion request parameters |
|
||||
@@ -0,0 +1,9 @@
|
||||
# UpdateGuardrailGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## 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 | {<br/>"name": "Updated Guardrail Name",<br/>"description": "Updated description",<br/>"limit_usd": 75,<br/>"reset_interval": "weekly"<br/>} |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | {<br/>"name": "Updated Guardrail Name",<br/>"description": "Updated description",<br/>"limit_usd": 75,<br/>"reset_interval": "weekly"<br/>} |
|
||||
@@ -0,0 +1,9 @@
|
||||
# UpdateKeysGlobals
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 | {<br/>"name": "Updated API Key Name",<br/>"disabled": false,<br/>"limit": 75,<br/>"limit_reset": "daily",<br/>"include_byok_in_limit": true<br/>} |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | {<br/>"name": "Updated API Key Name",<br/>"disabled": false,<br/>"limit": 75,<br/>"limit_reset": "daily",<br/>"include_byok_in_limit": true<br/>} |
|
||||
@@ -22,6 +22,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -34,10 +36,12 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- |
|
||||
| `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `date_` | *Optional[str]* | :heavy_minus_sign: | Filter by a single UTC date in the last 30 days (YYYY-MM-DD format). | 2025-08-24 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+40
-16
@@ -27,6 +27,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -39,11 +41,13 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false |
|
||||
| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `include_disabled` | *Optional[str]* | :heavy_minus_sign: | Whether to include disabled API keys in the response | false |
|
||||
| `offset` | *Optional[str]* | :heavy_minus_sign: | Number of API keys to skip for pagination | 0 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -71,6 +75,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -86,6 +92,8 @@ with OpenRouter(
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | *str* | :heavy_check_mark: | Name for the new API key | My New API Key |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `limit` | *OptionalNullable[float]* | :heavy_minus_sign: | Optional spending limit for the API key in USD | 50 |
|
||||
| `limit_reset` | [OptionalNullable[operations.CreateKeysLimitReset]](../../operations/createkeyslimitreset.md) | :heavy_minus_sign: | 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. | monthly |
|
||||
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
|
||||
@@ -119,6 +127,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -134,6 +144,8 @@ with OpenRouter(
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to update | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 |
|
||||
@@ -169,6 +181,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -181,10 +195,12 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -213,6 +229,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -225,10 +243,12 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to retrieve | f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -257,6 +277,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -269,9 +291,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+36
-32
@@ -20,6 +20,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -34,38 +36,40 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | N/A |
|
||||
| `provider` | [OptionalNullable[components.Schema0]](../../components/schema0.md) | :heavy_minus_sign: | N/A |
|
||||
| `plugins` | List[[components.Schema17](../../components/schema17.md)] | :heavy_minus_sign: | N/A |
|
||||
| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
||||
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | N/A |
|
||||
| `response_format` | [Optional[components.ResponseFormat]](../../components/responseformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `stop` | [OptionalNullable[components.Stop]](../../components/stop.md) | :heavy_minus_sign: | N/A |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
|
||||
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
|
||||
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `provider` | [OptionalNullable[components.Schema0]](../../components/schema0.md) | :heavy_minus_sign: | N/A |
|
||||
| `plugins` | List[[components.Schema17](../../components/schema17.md)] | :heavy_minus_sign: | N/A |
|
||||
| `route` | [OptionalNullable[components.Route]](../../components/route.md) | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `session_id` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
|
||||
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `logit_bias` | Dict[str, *float*] | :heavy_minus_sign: | N/A |
|
||||
| `logprobs` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `top_logprobs` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_completion_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `max_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
|
||||
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `reasoning` | [Optional[components.Reasoning]](../../components/reasoning.md) | :heavy_minus_sign: | N/A |
|
||||
| `response_format` | [Optional[components.ResponseFormat]](../../components/responseformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
|
||||
| `stop` | [OptionalNullable[components.Stop]](../../components/stop.md) | :heavy_minus_sign: | N/A |
|
||||
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
|
||||
| `stream_options` | [OptionalNullable[components.ChatStreamOptions]](../../components/chatstreamoptions.md) | :heavy_minus_sign: | N/A |
|
||||
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `tool_choice` | *Optional[Any]* | :heavy_minus_sign: | N/A |
|
||||
| `tools` | List[[components.ToolDefinitionJSON](../../components/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
|
||||
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
|
||||
| `debug` | [Optional[components.Debug]](../../components/debug.md) | :heavy_minus_sign: | N/A |
|
||||
| `image_config` | Dict[str, [components.ChatGenerationParamsImageConfig](../../components/chatgenerationparamsimageconfig.md)] | :heavy_minus_sign: | N/A |
|
||||
| `modalities` | List[[components.Modality](../../components/modality.md)] | :heavy_minus_sign: | N/A |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+20
-11
@@ -23,6 +23,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -35,9 +37,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -64,7 +68,10 @@ from openrouter import OpenRouter, operations
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter() as open_router:
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
) as open_router:
|
||||
|
||||
res = open_router.credits.create_coinbase_charge(security=operations.CreateCoinbaseChargeSecurity(
|
||||
bearer=os.getenv("OPENROUTER_BEARER", ""),
|
||||
@@ -77,13 +84,15 @@ with OpenRouter() as open_router:
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `security` | [operations.CreateCoinbaseChargeSecurity](../../operations/createcoinbasechargesecurity.md) | :heavy_check_mark: | N/A |
|
||||
| `amount` | *float* | :heavy_check_mark: | N/A |
|
||||
| `sender` | *str* | :heavy_check_mark: | N/A |
|
||||
| `chain_id` | [components.ChainID](../../components/chainid.md) | :heavy_check_mark: | 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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `security` | [operations.CreateCoinbaseChargeSecurity](../../operations/createcoinbasechargesecurity.md) | :heavy_check_mark: | N/A |
|
||||
| `amount` | *float* | :heavy_check_mark: | N/A |
|
||||
| `sender` | *str* | :heavy_check_mark: | N/A |
|
||||
| `chain_id` | [components.ChainID](../../components/chainid.md) | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -35,16 +37,18 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||||
| `input` | [operations.InputUnion](../../operations/inputunion.md) | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `provider` | [Optional[components.ProviderPreferences]](../../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. |
|
||||
| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `input` | [operations.InputUnion](../../operations/inputunion.md) | :heavy_check_mark: | N/A |
|
||||
| `model` | *str* | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A |
|
||||
| `dimensions` | *Optional[int]* | :heavy_minus_sign: | N/A |
|
||||
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `provider` | [Optional[components.ProviderPreferences]](../../components/providerpreferences.md) | :heavy_minus_sign: | Provider routing preferences for the request. |
|
||||
| `input_type` | *Optional[str]* | :heavy_minus_sign: | N/A |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -79,6 +83,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -91,9 +97,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -35,11 +37,13 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `author` | *str* | :heavy_check_mark: | N/A |
|
||||
| `slug` | *str* | :heavy_check_mark: | 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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `author` | *str* | :heavy_check_mark: | N/A |
|
||||
| `slug` | *str* | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -66,6 +70,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -78,9 +84,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -34,10 +36,12 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | 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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+128
-76
@@ -34,6 +34,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -46,11 +48,13 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -77,6 +81,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -89,16 +95,18 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2",<br/>"anthropic/claude-4.5-opus-20251124",<br/>"deepseek/deepseek-r1-0528:free"<br/>] |
|
||||
| `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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `name` | *str* | :heavy_check_mark: | Name for the new guardrail | My New Guardrail |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2",<br/>"anthropic/claude-4.5-opus-20251124",<br/>"deepseek/deepseek-r1-0528:free"<br/>] |
|
||||
| `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
|
||||
|
||||
@@ -126,6 +134,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -138,10 +148,12 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to retrieve | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -169,6 +181,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -181,17 +195,19 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2"<br/>] |
|
||||
| `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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to update | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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 | [<br/>"openai",<br/>"anthropic",<br/>"deepseek"<br/>] |
|
||||
| `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [<br/>"openai/gpt-5.2"<br/>] |
|
||||
| `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
|
||||
|
||||
@@ -220,6 +236,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -232,10 +250,12 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail to delete | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -263,6 +283,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -275,11 +297,13 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -306,6 +330,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -318,11 +344,13 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -349,6 +377,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -361,12 +391,14 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -394,6 +426,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -408,11 +442,13 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"<br/>] |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 | [<br/>"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"<br/>] |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -441,6 +477,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -453,12 +491,14 @@ with OpenRouter(
|
||||
|
||||
### 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `id` | *str* | :heavy_check_mark: | The unique identifier of the guardrail | 550e8400-e29b-41d4-a716-446655440000 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -486,6 +526,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -501,11 +543,13 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"user_abc123",<br/>"user_def456"<br/>] |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 | [<br/>"user_abc123",<br/>"user_def456"<br/>] |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -534,6 +578,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -548,11 +594,13 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"<br/>] |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 | [<br/>"c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93"<br/>] |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -581,6 +629,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -596,11 +646,13 @@ with OpenRouter(
|
||||
|
||||
### 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 | [<br/>"user_abc123",<br/>"user_def456"<br/>] |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `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 | [<br/>"user_abc123",<br/>"user_def456"<br/>] |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+26
-13
@@ -24,6 +24,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -36,9 +38,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -64,6 +68,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -76,11 +82,13 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| 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. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `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
|
||||
|
||||
@@ -106,7 +114,10 @@ from openrouter import OpenRouter, operations
|
||||
import os
|
||||
|
||||
|
||||
with OpenRouter() as open_router:
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
) as open_router:
|
||||
|
||||
res = open_router.models.list_for_user(security=operations.ListModelsUserSecurity(
|
||||
bearer=os.getenv("OPENROUTER_BEARER", ""),
|
||||
@@ -119,10 +130,12 @@ with OpenRouter() as open_router:
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
||||
| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `security` | [operations.ListModelsUserSecurity](../../operations/listmodelsusersecurity.md) | :heavy_check_mark: | N/A |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+22
-14
@@ -23,6 +23,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -35,12 +37,14 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 |
|
||||
| `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk |
|
||||
| `code_challenge_method` | [OptionalNullable[operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../../operations/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk |
|
||||
| `code_challenge_method` | [OptionalNullable[operations.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../../operations/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -68,6 +72,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -80,14 +86,16 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| `callback_url` | *str* | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback |
|
||||
| `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM |
|
||||
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `callback_url` | *str* | :heavy_check_mark: | The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are allowed. | https://myapp.com/auth/callback |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `code_challenge` | *Optional[str]* | :heavy_minus_sign: | PKCE code challenge for enhanced security | E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM |
|
||||
| `code_challenge_method` | [Optional[operations.CreateAuthKeysCodeCodeChallengeMethod]](../../operations/createauthkeyscodecodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
|
||||
| `limit` | *Optional[float]* | :heavy_minus_sign: | Credit limit for the API key to be created | 100 |
|
||||
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Optional expiration time for the API key to be created | |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -34,9 +36,11 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `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 |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import os
|
||||
|
||||
|
||||
with OpenRouter(
|
||||
http_referer="<value>",
|
||||
x_title="<value>",
|
||||
api_key=os.getenv("OPENROUTER_API_KEY", ""),
|
||||
) as open_router:
|
||||
|
||||
@@ -38,6 +40,8 @@ with OpenRouter(
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `input` | [Optional[components.OpenResponsesInput]](../../components/openresponsesinput.md) | :heavy_minus_sign: | Input for a response request - can be a string or array of items | [<br/>{<br/>"role": "user",<br/>"content": "What is the weather today?"<br/>}<br/>] |
|
||||
| `instructions` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
|
||||
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must be ≤512 characters. Maximum 16 pairs allowed. | {<br/>"user_id": "123",<br/>"session_id": "abc-def-ghi"<br/>} |
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "openrouter"
|
||||
version = "0.4.1"
|
||||
version = "0.5.1"
|
||||
description = "Official Python Client SDK for OpenRouter."
|
||||
authors = [{ name = "OpenRouter" },]
|
||||
readme = "README-PYPI.md"
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
import importlib.metadata
|
||||
|
||||
__title__: str = "openrouter"
|
||||
__version__: str = "0.4.1"
|
||||
__version__: str = "0.5.1"
|
||||
__openapi_doc_version__: str = "1.0.0"
|
||||
__gen_version__: str = "2.768.0"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.4.1 2.768.0 1.0.0 openrouter"
|
||||
__user_agent__: str = "speakeasy-sdk/python 0.5.1 2.768.0 1.0.0 openrouter"
|
||||
|
||||
try:
|
||||
if __package__ is not None:
|
||||
|
||||
@@ -15,6 +15,8 @@ class Analytics(BaseSDK):
|
||||
def get_user_activity(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
date_: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -25,6 +27,11 @@ class Analytics(BaseSDK):
|
||||
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -42,6 +49,8 @@ class Analytics(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetUserActivityRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
date_=date_,
|
||||
)
|
||||
|
||||
@@ -57,6 +66,10 @@ class Analytics(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetUserActivityGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -124,6 +137,8 @@ class Analytics(BaseSDK):
|
||||
async def get_user_activity_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
date_: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
@@ -134,6 +149,11 @@ class Analytics(BaseSDK):
|
||||
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
:param server_url: Override the default server URL for this method
|
||||
@@ -151,6 +171,8 @@ class Analytics(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetUserActivityRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
date_=date_,
|
||||
)
|
||||
|
||||
@@ -166,6 +188,10 @@ class Analytics(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetUserActivityGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+190
-14
@@ -16,6 +16,8 @@ class APIKeys(BaseSDK):
|
||||
def list(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
include_disabled: Optional[str] = None,
|
||||
offset: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -27,6 +29,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -45,6 +52,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
include_disabled=include_disabled,
|
||||
offset=offset,
|
||||
)
|
||||
@@ -61,6 +70,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -123,6 +136,8 @@ class APIKeys(BaseSDK):
|
||||
async def list_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
include_disabled: Optional[str] = None,
|
||||
offset: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
@@ -134,6 +149,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
List all API keys for the authenticated user. [Provisioning key](/docs/guides/overview/auth/provisioning-api-keys) required.
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -152,6 +172,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.ListRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
include_disabled=include_disabled,
|
||||
offset=offset,
|
||||
)
|
||||
@@ -168,6 +190,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.ListGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -231,6 +257,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
|
||||
include_byok_in_limit: Optional[bool] = None,
|
||||
@@ -245,6 +273,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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.
|
||||
:param include_byok_in_limit: Whether to include BYOK usage in the limit
|
||||
@@ -265,11 +298,15 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateKeysRequest(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateKeysRequestBody(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -284,9 +321,17 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateKeysRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateKeysRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -355,6 +400,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
limit_reset: OptionalNullable[operations.CreateKeysLimitReset] = UNSET,
|
||||
include_byok_in_limit: Optional[bool] = None,
|
||||
@@ -369,6 +416,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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.
|
||||
:param include_byok_in_limit: Whether to include BYOK usage in the limit
|
||||
@@ -389,11 +441,15 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.CreateKeysRequest(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
request_body=operations.CreateKeysRequestBody(
|
||||
name=name,
|
||||
limit=limit,
|
||||
limit_reset=limit_reset,
|
||||
include_byok_in_limit=include_byok_in_limit,
|
||||
expires_at=expires_at,
|
||||
),
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -408,9 +464,17 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.CreateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", operations.CreateKeysRequest
|
||||
request.request_body,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
operations.CreateKeysRequestBody,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -479,6 +543,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
name: Optional[str] = None,
|
||||
disabled: Optional[bool] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
@@ -494,6 +560,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
:param limit: New spending limit for the API key in USD
|
||||
@@ -515,6 +586,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.UpdateKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
request_body=operations.UpdateKeysRequestBody(
|
||||
name=name,
|
||||
@@ -537,6 +610,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.UpdateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
@@ -617,6 +694,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
name: Optional[str] = None,
|
||||
disabled: Optional[bool] = None,
|
||||
limit: OptionalNullable[float] = UNSET,
|
||||
@@ -632,6 +711,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param name: New name for the API key
|
||||
:param disabled: Whether to disable the API key
|
||||
:param limit: New spending limit for the API key in USD
|
||||
@@ -653,6 +737,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.UpdateKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
request_body=operations.UpdateKeysRequestBody(
|
||||
name=name,
|
||||
@@ -675,6 +761,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.UpdateKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request.request_body,
|
||||
@@ -755,6 +845,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -765,6 +857,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -781,6 +878,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.DeleteKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -796,6 +895,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.DeleteKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -864,6 +967,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -874,6 +979,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -890,6 +1000,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.DeleteKeysRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -905,6 +1017,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.DeleteKeysGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -973,6 +1089,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -983,6 +1101,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -999,6 +1122,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -1014,6 +1139,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1082,6 +1211,8 @@ class APIKeys(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
hash: str,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1092,6 +1223,11 @@ class APIKeys(BaseSDK):
|
||||
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 http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -1108,6 +1244,8 @@ class APIKeys(BaseSDK):
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
hash=hash,
|
||||
)
|
||||
|
||||
@@ -1123,6 +1261,10 @@ class APIKeys(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.GetKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1190,6 +1332,8 @@ class APIKeys(BaseSDK):
|
||||
def get_current_key_metadata(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1199,6 +1343,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
Get information on the API key associated with the current authentication session
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -1213,18 +1362,28 @@ class APIKeys(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCurrentKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
method="GET",
|
||||
path="/key",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
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,
|
||||
_globals=operations.GetCurrentKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -1282,6 +1441,8 @@ class APIKeys(BaseSDK):
|
||||
async def get_current_key_metadata_async(
|
||||
self,
|
||||
*,
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
@@ -1291,6 +1452,11 @@ class APIKeys(BaseSDK):
|
||||
|
||||
Get information on the API key associated with the current authentication session
|
||||
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
: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
|
||||
@@ -1305,18 +1471,28 @@ class APIKeys(BaseSDK):
|
||||
base_url = server_url
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = operations.GetCurrentKeyRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
method="GET",
|
||||
path="/key",
|
||||
base_url=base_url,
|
||||
url_variables=url_variables,
|
||||
request=None,
|
||||
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,
|
||||
_globals=operations.GetCurrentKeyGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
+150
-84
@@ -21,6 +21,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -81,6 +83,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -121,6 +128,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -181,6 +190,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -220,6 +234,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -280,6 +296,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -324,48 +345,52 @@ class Chat(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
request = operations.SendChatCompletionRequestRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
chat_generation_params=components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
)
|
||||
|
||||
req = self._build_request(
|
||||
@@ -380,9 +405,17 @@ class Chat(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.SendChatCompletionRequestGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.ChatGenerationParams
|
||||
request.chat_generation_params,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.ChatGenerationParams,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
@@ -460,6 +493,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -520,6 +555,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -560,6 +600,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -620,6 +662,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -659,6 +706,8 @@ class Chat(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
messages: Union[List[components.Message], List[components.MessageTypedDict]],
|
||||
http_referer: Optional[str] = None,
|
||||
x_title: Optional[str] = None,
|
||||
provider: OptionalNullable[
|
||||
Union[components.Schema0, components.Schema0TypedDict]
|
||||
] = UNSET,
|
||||
@@ -719,6 +768,11 @@ class Chat(BaseSDK):
|
||||
Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
||||
|
||||
:param messages:
|
||||
:param http_referer: The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
||||
This is used to track API usage per application.
|
||||
|
||||
:param x_title: The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
||||
|
||||
:param provider:
|
||||
:param plugins:
|
||||
:param route:
|
||||
@@ -763,48 +817,52 @@ class Chat(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
request = operations.SendChatCompletionRequestRequest(
|
||||
http_referer=http_referer,
|
||||
x_title=x_title,
|
||||
chat_generation_params=components.ChatGenerationParams(
|
||||
provider=utils.get_pydantic_model(
|
||||
provider, OptionalNullable[components.Schema0]
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
),
|
||||
plugins=utils.get_pydantic_model(
|
||||
plugins, Optional[List[components.Schema17]]
|
||||
),
|
||||
route=route,
|
||||
user=user,
|
||||
session_id=session_id,
|
||||
messages=utils.get_pydantic_model(messages, List[components.Message]),
|
||||
model=model,
|
||||
models=models,
|
||||
frequency_penalty=frequency_penalty,
|
||||
logit_bias=logit_bias,
|
||||
logprobs=logprobs,
|
||||
top_logprobs=top_logprobs,
|
||||
max_completion_tokens=max_completion_tokens,
|
||||
max_tokens=max_tokens,
|
||||
metadata=metadata,
|
||||
presence_penalty=presence_penalty,
|
||||
reasoning=utils.get_pydantic_model(
|
||||
reasoning, Optional[components.Reasoning]
|
||||
),
|
||||
response_format=utils.get_pydantic_model(
|
||||
response_format, Optional[components.ResponseFormat]
|
||||
),
|
||||
seed=seed,
|
||||
stop=stop,
|
||||
stream=stream,
|
||||
stream_options=utils.get_pydantic_model(
|
||||
stream_options, OptionalNullable[components.ChatStreamOptions]
|
||||
),
|
||||
temperature=temperature,
|
||||
tool_choice=tool_choice,
|
||||
tools=utils.get_pydantic_model(
|
||||
tools, Optional[List[components.ToolDefinitionJSON]]
|
||||
),
|
||||
top_p=top_p,
|
||||
debug=utils.get_pydantic_model(debug, Optional[components.Debug]),
|
||||
image_config=image_config,
|
||||
modalities=modalities,
|
||||
)
|
||||
|
||||
req = self._build_request_async(
|
||||
@@ -819,9 +877,17 @@ class Chat(BaseSDK):
|
||||
user_agent_header="user-agent",
|
||||
accept_header_value="text/event-stream" if stream else "application/json",
|
||||
http_headers=http_headers,
|
||||
_globals=operations.SendChatCompletionRequestGlobals(
|
||||
http_referer=self.sdk_configuration.globals.http_referer,
|
||||
x_title=self.sdk_configuration.globals.x_title,
|
||||
),
|
||||
security=self.sdk_configuration.security,
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", components.ChatGenerationParams
|
||||
request.chat_generation_params,
|
||||
False,
|
||||
False,
|
||||
"json",
|
||||
components.ChatGenerationParams,
|
||||
),
|
||||
allow_empty_value=None,
|
||||
timeout_ms=timeout_ms,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user