This commit is contained in:
Matt Apperson
2025-11-13 14:21:27 -05:00
parent d13e797ad1
commit 94ba44c933
795 changed files with 5179 additions and 4513 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ with OpenRouter(
### Response
**[models.GetUserActivityResponse](../../models/getuseractivityresponse.md)**
**[operations.GetUserActivityResponse](../../operations/getuseractivityresponse.md)**
### Errors
+8 -8
View File
@@ -47,7 +47,7 @@ with OpenRouter(
### Response
**[models.ListResponse](../../models/listresponse.md)**
**[operations.ListResponse](../../operations/listresponse.md)**
### Errors
@@ -88,14 +88,14 @@ with OpenRouter(
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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[models.CreateKeysLimitReset]](../../models/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 |
| `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 |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
**[models.CreateKeysResponse](../../models/createkeysresponse.md)**
**[operations.CreateKeysResponse](../../operations/createkeysresponse.md)**
### Errors
@@ -138,13 +138,13 @@ with OpenRouter(
| `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 |
| `limit_reset` | [OptionalNullable[models.UpdateKeysLimitReset]](../../models/updatekeyslimitreset.md) | :heavy_minus_sign: | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily |
| `limit_reset` | [OptionalNullable[operations.UpdateKeysLimitReset]](../../operations/updatekeyslimitreset.md) | :heavy_minus_sign: | New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday. | daily |
| `include_byok_in_limit` | *Optional[bool]* | :heavy_minus_sign: | Whether to include BYOK usage in the limit | true |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
**[models.UpdateKeysResponse](../../models/updatekeysresponse.md)**
**[operations.UpdateKeysResponse](../../operations/updatekeysresponse.md)**
### Errors
@@ -189,7 +189,7 @@ with OpenRouter(
### Response
**[models.DeleteKeysResponse](../../models/deletekeysresponse.md)**
**[operations.DeleteKeysResponse](../../operations/deletekeysresponse.md)**
### Errors
@@ -233,7 +233,7 @@ with OpenRouter(
### Response
**[models.GetKeyResponse](../../models/getkeyresponse.md)**
**[operations.GetKeyResponse](../../operations/getkeyresponse.md)**
### Errors
@@ -276,7 +276,7 @@ with OpenRouter(
### Response
**[models.GetCurrentKeyResponse](../../models/getcurrentkeyresponse.md)**
**[operations.GetCurrentKeyResponse](../../operations/getcurrentkeyresponse.md)**
### Errors
+26 -26
View File
@@ -34,35 +34,35 @@ with OpenRouter(
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `messages` | List[[models.Message](../../models/message.md)] | :heavy_check_mark: | 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[models.Reasoning]](../../models/reasoning.md) | :heavy_minus_sign: | N/A |
| `response_format` | [Optional[models.ChatGenerationParamsResponseFormatUnion]](../../models/chatgenerationparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[models.ChatGenerationParamsStop]](../../models/chatgenerationparamsstop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[models.ChatStreamOptions]](../../models/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[[models.ToolDefinitionJSON](../../models/tooldefinitionjson.md)] | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `user` | *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 |
| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `messages` | List[[components.Message](../../components/message.md)] | :heavy_check_mark: | 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.ChatGenerationParamsResponseFormatUnion]](../../components/chatgenerationparamsresponseformatunion.md) | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.ChatGenerationParamsStop]](../../components/chatgenerationparamsstop.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 |
| `user` | *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
**[models.SendChatCompletionRequestResponse](../../models/sendchatcompletionrequestresponse.md)**
**[operations.SendChatCompletionRequestResponse](../../operations/sendchatcompletionrequestresponse.md)**
### Errors
+25 -25
View File
@@ -32,34 +32,34 @@ with OpenRouter(
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | [models.Prompt](../../models/prompt.md) | :heavy_check_mark: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `best_of` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `echo` | *OptionalNullable[bool]* | :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[int]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[models.CompletionCreateParamsStop]](../../models/completioncreateparamsstop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[models.StreamOptions]](../../models/streamoptions.md) | :heavy_minus_sign: | N/A |
| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `response_format` | [OptionalNullable[models.CompletionCreateParamsResponseFormatUnion]](../../models/completioncreateparamsresponseformatunion.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 |
| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt` | [components.Prompt](../../components/prompt.md) | :heavy_check_mark: | N/A |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `best_of` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `echo` | *OptionalNullable[bool]* | :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[int]* | :heavy_minus_sign: | N/A |
| `max_tokens` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `n` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `presence_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `seed` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A |
| `stop` | [OptionalNullable[components.CompletionCreateParamsStop]](../../components/completioncreateparamsstop.md) | :heavy_minus_sign: | N/A |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A |
| `stream_options` | [OptionalNullable[components.StreamOptions]](../../components/streamoptions.md) | :heavy_minus_sign: | N/A |
| `suffix` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `user` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `metadata` | Dict[str, *str*] | :heavy_minus_sign: | N/A |
| `response_format` | [OptionalNullable[components.CompletionCreateParamsResponseFormatUnion]](../../components/completioncreateparamsresponseformatunion.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
**[models.CompletionResponse](../../models/completionresponse.md)**
**[components.CompletionResponse](../../components/completionresponse.md)**
### Errors
+11 -11
View File
@@ -41,7 +41,7 @@ with OpenRouter(
### Response
**[models.GetCreditsResponse](../../models/getcreditsresponse.md)**
**[operations.GetCreditsResponse](../../operations/getcreditsresponse.md)**
### Errors
@@ -60,13 +60,13 @@ Create a Coinbase charge for crypto payment
<!-- UsageSnippet language="python" operationID="createCoinbaseCharge" method="post" path="/credits/coinbase" -->
```python
from openrouter import OpenRouter, models
from openrouter import OpenRouter, operations
import os
with OpenRouter() as open_router:
res = open_router.credits.create_coinbase_charge(security=models.CreateCoinbaseChargeSecurity(
res = open_router.credits.create_coinbase_charge(security=operations.CreateCoinbaseChargeSecurity(
bearer=os.getenv("OPENROUTER_BEARER", ""),
), amount=100, sender="0x1234567890123456789012345678901234567890", chain_id=1)
@@ -77,17 +77,17 @@ with OpenRouter() as open_router:
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `security` | [models.CreateCoinbaseChargeSecurity](../../models/createcoinbasechargesecurity.md) | :heavy_check_mark: | N/A |
| `amount` | *float* | :heavy_check_mark: | N/A |
| `sender` | *str* | :heavy_check_mark: | N/A |
| `chain_id` | [models.ChainID](../../models/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 |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response
**[models.CreateCoinbaseChargeResponse](../../models/createcoinbasechargeresponse.md)**
**[operations.CreateCoinbaseChargeResponse](../../operations/createcoinbasechargeresponse.md)**
### Errors
+10 -10
View File
@@ -52,18 +52,18 @@ with OpenRouter(
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `input` | [models.Input](../../models/input.md) | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `provider` | [Optional[models.CreateEmbeddingsProvider]](../../models/createembeddingsprovider.md) | :heavy_minus_sign: | N/A |
| `encoding_format` | [Optional[models.EncodingFormat]](../../models/encodingformat.md) | :heavy_minus_sign: | N/A |
| `user` | *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.Input](../../operations/input.md) | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `provider` | [Optional[operations.CreateEmbeddingsProvider]](../../operations/createembeddingsprovider.md) | :heavy_minus_sign: | N/A |
| `encoding_format` | [Optional[operations.EncodingFormat]](../../operations/encodingformat.md) | :heavy_minus_sign: | N/A |
| `user` | *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
**[models.CreateEmbeddingsResponse](../../models/createembeddingsresponse.md)**
**[operations.CreateEmbeddingsResponse](../../operations/createembeddingsresponse.md)**
### Errors
@@ -112,7 +112,7 @@ with OpenRouter(
### Response
**[models.ModelsListResponse](../../models/modelslistresponse.md)**
**[components.ModelsListResponse](../../components/modelslistresponse.md)**
### Errors
+2 -2
View File
@@ -43,7 +43,7 @@ with OpenRouter(
### Response
**[models.EndpointsListEndpointsResponse](../../models/endpointslistendpointsresponse.md)**
**[operations.ListEndpointsResponse](../../operations/listendpointsresponse.md)**
### Errors
@@ -84,7 +84,7 @@ with OpenRouter(
### Response
**[models.ListEndpointsZdrResponse](../../models/listendpointszdrresponse.md)**
**[operations.ListEndpointsZdrResponse](../../operations/listendpointszdrresponse.md)**
### Errors
+1 -1
View File
@@ -41,7 +41,7 @@ with OpenRouter(
### Response
**[models.GetGenerationResponse](../../models/getgenerationresponse.md)**
**[operations.GetGenerationResponse](../../operations/getgenerationresponse.md)**
### Errors
+9 -9
View File
@@ -42,7 +42,7 @@ with OpenRouter(
### Response
**[models.ModelsCountResponse](../../models/modelscountresponse.md)**
**[components.ModelsCountResponse](../../components/modelscountresponse.md)**
### Errors
@@ -84,7 +84,7 @@ with OpenRouter(
### Response
**[models.ModelsListResponse](../../models/modelslistresponse.md)**
**[components.ModelsListResponse](../../components/modelslistresponse.md)**
### Errors
@@ -102,13 +102,13 @@ List models filtered by user provider preferences
<!-- UsageSnippet language="python" operationID="listModelsUser" method="get" path="/models/user" -->
```python
from openrouter import OpenRouter, models
from openrouter import OpenRouter, operations
import os
with OpenRouter() as open_router:
res = open_router.models.list_for_user(security=models.ListModelsUserSecurity(
res = open_router.models.list_for_user(security=operations.ListModelsUserSecurity(
bearer=os.getenv("OPENROUTER_BEARER", ""),
))
@@ -119,14 +119,14 @@ with OpenRouter() as open_router:
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `security` | [models.ListModelsUserSecurity](../../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: | 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. |
### Response
**[models.ModelsListResponse](../../models/modelslistresponse.md)**
**[components.ModelsListResponse](../../components/modelslistresponse.md)**
### Errors
+16 -16
View File
@@ -35,16 +35,16 @@ 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[models.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../../models/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 |
| `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
**[models.ExchangeAuthCodeForAPIKeyResponse](../../models/exchangeauthcodeforapikeyresponse.md)**
**[operations.ExchangeAuthCodeForAPIKeyResponse](../../operations/exchangeauthcodeforapikeyresponse.md)**
### Errors
@@ -80,18 +80,18 @@ 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[models.CreateAuthKeysCodeCodeChallengeMethod]](../../models/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 |
| `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
**[models.CreateAuthKeysCodeResponse](../../models/createauthkeyscoderesponse.md)**
**[operations.CreateAuthKeysCodeResponse](../../operations/createauthkeyscoderesponse.md)**
### Errors
+10 -10
View File
@@ -17,13 +17,13 @@ Get a model's supported parameters and data about which are most popular
<!-- UsageSnippet language="python" operationID="getParameters" method="get" path="/parameters/{author}/{slug}" -->
```python
from openrouter import OpenRouter, models
from openrouter import OpenRouter, operations
import os
with OpenRouter() as open_router:
res = open_router.parameters.get_parameters(security=models.GetParametersSecurity(
res = open_router.parameters.get_parameters(security=operations.GetParametersSecurity(
bearer=os.getenv("OPENROUTER_BEARER", ""),
), author="<value>", slug="<value>")
@@ -34,17 +34,17 @@ with OpenRouter() as open_router:
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `security` | [models.GetParametersSecurity](../../models/getparameterssecurity.md) | :heavy_check_mark: | N/A |
| `author` | *str* | :heavy_check_mark: | N/A |
| `slug` | *str* | :heavy_check_mark: | N/A |
| `provider` | [Optional[models.GetParametersProvider]](../../models/getparametersprovider.md) | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
| Parameter | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `security` | [operations.GetParametersSecurity](../../operations/getparameterssecurity.md) | :heavy_check_mark: | N/A |
| `author` | *str* | :heavy_check_mark: | N/A |
| `slug` | *str* | :heavy_check_mark: | N/A |
| `provider` | [Optional[operations.GetParametersProvider]](../../operations/getparametersprovider.md) | :heavy_minus_sign: | N/A |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
### Response
**[models.GetParametersResponse](../../models/getparametersresponse.md)**
**[operations.GetParametersResponse](../../operations/getparametersresponse.md)**
### Errors
+1 -1
View File
@@ -40,7 +40,7 @@ with OpenRouter(
### Response
**[models.ListProvidersResponse](../../models/listprovidersresponse.md)**
**[operations.ListProvidersResponse](../../operations/listprovidersresponse.md)**
### Errors
+12 -12
View File
@@ -92,38 +92,38 @@ with OpenRouter(
| Parameter | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input` | [Optional[models.OpenResponsesInput]](../../models/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/>] |
| `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/>} |
| `tools` | List[[models.OpenResponsesRequestToolUnion](../../models/openresponsesrequesttoolunion.md)] | :heavy_minus_sign: | N/A | |
| `tool_choice` | [Optional[models.OpenAIResponsesToolChoiceUnion]](../../models/openairesponsestoolchoiceunion.md) | :heavy_minus_sign: | N/A | |
| `tools` | List[[components.OpenResponsesRequestToolUnion](../../components/openresponsesrequesttoolunion.md)] | :heavy_minus_sign: | N/A | |
| `tool_choice` | [Optional[components.OpenAIResponsesToolChoiceUnion]](../../components/openairesponsestoolchoiceunion.md) | :heavy_minus_sign: | N/A | |
| `parallel_tool_calls` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A | |
| `models` | List[*str*] | :heavy_minus_sign: | N/A | |
| `text` | [Optional[models.OpenResponsesResponseText]](../../models/openresponsesresponsetext.md) | :heavy_minus_sign: | Text output configuration including format and verbosity | {<br/>"format": {<br/>"type": "text"<br/>},<br/>"verbosity": "medium"<br/>} |
| `reasoning` | [OptionalNullable[models.OpenResponsesReasoningConfig]](../../models/openresponsesreasoningconfig.md) | :heavy_minus_sign: | Configuration for reasoning mode in the response | {<br/>"summary": "auto",<br/>"enabled": true<br/>} |
| `text` | [Optional[components.OpenResponsesResponseText]](../../components/openresponsesresponsetext.md) | :heavy_minus_sign: | Text output configuration including format and verbosity | {<br/>"format": {<br/>"type": "text"<br/>},<br/>"verbosity": "medium"<br/>} |
| `reasoning` | [OptionalNullable[components.OpenResponsesReasoningConfig]](../../components/openresponsesreasoningconfig.md) | :heavy_minus_sign: | Configuration for reasoning mode in the response | {<br/>"summary": "auto",<br/>"enabled": true<br/>} |
| `max_output_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A | |
| `top_k` | *Optional[float]* | :heavy_minus_sign: | N/A | |
| `prompt_cache_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `previous_response_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `prompt` | [OptionalNullable[models.OpenAIResponsesPrompt]](../../models/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | |
| `include` | List[[models.OpenAIResponsesIncludable](../../models/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
| `prompt` | [OptionalNullable[components.OpenAIResponsesPrompt]](../../components/openairesponsesprompt.md) | :heavy_minus_sign: | N/A | |
| `include` | List[[components.OpenAIResponsesIncludable](../../components/openairesponsesincludable.md)] | :heavy_minus_sign: | N/A | |
| `background` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `safety_identifier` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
| `store` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | |
| `service_tier` | [OptionalNullable[models.ServiceTier]](../../models/servicetier.md) | :heavy_minus_sign: | N/A | auto |
| `truncation` | [OptionalNullable[models.Truncation]](../../models/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `service_tier` | [OptionalNullable[components.ServiceTier]](../../components/servicetier.md) | :heavy_minus_sign: | N/A | auto |
| `truncation` | [OptionalNullable[components.Truncation]](../../components/truncation.md) | :heavy_minus_sign: | N/A | auto |
| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | |
| `provider` | [OptionalNullable[models.Provider]](../../models/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[models.Plugin](../../models/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `provider` | [OptionalNullable[components.Provider]](../../components/provider.md) | :heavy_minus_sign: | When multiple model providers are available, optionally indicate your routing preference. | |
| `plugins` | List[[components.Plugin](../../components/plugin.md)] | :heavy_minus_sign: | Plugins you want to enable for this request, including their settings. | |
| `user` | *Optional[str]* | :heavy_minus_sign: | A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 128 characters. | |
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
### Response
**[models.CreateResponsesResponse](../../models/createresponsesresponse.md)**
**[operations.CreateResponsesResponse](../../operations/createresponsesresponse.md)**
### Errors