Initial commit: OpenRouter Python SDK

Auto-generated Python SDK for OpenRouter API, providing comprehensive client library with:
- Chat completions and streaming support
- Embeddings API
- Model and provider information
- API key management
- Analytics and usage tracking
- OAuth authentication flows
- Full type hints and error handling
This commit is contained in:
Matt Apperson
2025-11-13 10:56:25 -05:00
commit 5fc522c72f
721 changed files with 45654 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
# BadGatewayResponseError
Bad Gateway - Provider/upstream API failure
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `error` | [models.BadGatewayResponseErrorData](../models/badgatewayresponseerrordata.md) | :heavy_check_mark: | Error data for BadGatewayResponse | {<br/>"code": 502,<br/>"message": "Provider returned error"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+11
View File
@@ -0,0 +1,11 @@
# BadRequestResponseError
Bad Request - Invalid request parameters or malformed input
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `error` | [models.BadRequestResponseErrorData](../models/badrequestresponseerrordata.md) | :heavy_check_mark: | Error data for BadRequestResponse | {<br/>"code": 400,<br/>"message": "Invalid request parameters"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+8
View File
@@ -0,0 +1,8 @@
# ChatError
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
| `error` | [models.ChatErrorError](../models/chaterrorerror.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,11 @@
# EdgeNetworkTimeoutResponseError
Infrastructure Timeout - Provider request timed out at edge network
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `error` | [models.EdgeNetworkTimeoutResponseErrorData](../models/edgenetworktimeoutresponseerrordata.md) | :heavy_check_mark: | Error data for EdgeNetworkTimeoutResponse | {<br/>"code": 524,<br/>"message": "Request timed out. Please try again later."<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+11
View File
@@ -0,0 +1,11 @@
# ForbiddenResponseError
Forbidden - Authentication successful but insufficient permissions
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `error` | [models.ForbiddenResponseErrorData](../models/forbiddenresponseerrordata.md) | :heavy_check_mark: | Error data for ForbiddenResponse | {<br/>"code": 403,<br/>"message": "Only provisioning keys can perform this operation"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# InternalServerResponseError
Internal Server Error - Unexpected server error
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `error` | [models.InternalServerResponseErrorData](../models/internalserverresponseerrordata.md) | :heavy_check_mark: | Error data for InternalServerResponse | {<br/>"code": 500,<br/>"message": "Internal Server Error"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+11
View File
@@ -0,0 +1,11 @@
# NotFoundResponseError
Not Found - Resource does not exist
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `error` | [models.NotFoundResponseErrorData](../models/notfoundresponseerrordata.md) | :heavy_check_mark: | Error data for NotFoundResponse | {<br/>"code": 404,<br/>"message": "Resource not found"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# PayloadTooLargeResponseError
Payload Too Large - Request payload exceeds size limits
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `error` | [models.PayloadTooLargeResponseErrorData](../models/payloadtoolargeresponseerrordata.md) | :heavy_check_mark: | Error data for PayloadTooLargeResponse | {<br/>"code": 413,<br/>"message": "Request payload too large"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# PaymentRequiredResponseError
Payment Required - Insufficient credits or quota to complete request
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `error` | [models.PaymentRequiredResponseErrorData](../models/paymentrequiredresponseerrordata.md) | :heavy_check_mark: | Error data for PaymentRequiredResponse | {<br/>"code": 402,<br/>"message": "Insufficient credits. Add more using https://openrouter.ai/credits"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# ProviderOverloadedResponseError
Provider Overloaded - Provider is temporarily overloaded
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `error` | [models.ProviderOverloadedResponseErrorData](../models/provideroverloadedresponseerrordata.md) | :heavy_check_mark: | Error data for ProviderOverloadedResponse | {<br/>"code": 529,<br/>"message": "Provider returned error"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# RequestTimeoutResponseError
Request Timeout - Operation exceeded time limit
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `error` | [models.RequestTimeoutResponseErrorData](../models/requesttimeoutresponseerrordata.md) | :heavy_check_mark: | Error data for RequestTimeoutResponse | {<br/>"code": 408,<br/>"message": "Operation timed out. Please try again later."<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# ServiceUnavailableResponseError
Service Unavailable - Service temporarily unavailable
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `error` | [models.ServiceUnavailableResponseErrorData](../models/serviceunavailableresponseerrordata.md) | :heavy_check_mark: | Error data for ServiceUnavailableResponse | {<br/>"code": 503,<br/>"message": "Service temporarily unavailable"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# TooManyRequestsResponseError
Too Many Requests - Rate limit exceeded
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `error` | [models.TooManyRequestsResponseErrorData](../models/toomanyrequestsresponseerrordata.md) | :heavy_check_mark: | Error data for TooManyRequestsResponse | {<br/>"code": 429,<br/>"message": "Rate limit exceeded"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+11
View File
@@ -0,0 +1,11 @@
# UnauthorizedResponseError
Unauthorized - Authentication required or invalid credentials
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `error` | [models.UnauthorizedResponseErrorData](../models/unauthorizedresponseerrordata.md) | :heavy_check_mark: | Error data for UnauthorizedResponse | {<br/>"code": 401,<br/>"message": "Missing Authentication header"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
@@ -0,0 +1,11 @@
# UnprocessableEntityResponseError
Unprocessable Entity - Semantic validation failure
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `error` | [models.UnprocessableEntityResponseErrorData](../models/unprocessableentityresponseerrordata.md) | :heavy_check_mark: | Error data for UnprocessableEntityResponse | {<br/>"code": 422,<br/>"message": "Invalid argument"<br/>} |
| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | |
+18
View File
@@ -0,0 +1,18 @@
# ActivityItem
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
| `date_` | *str* | :heavy_check_mark: | Date of the activity (YYYY-MM-DD format) | 2025-08-24 |
| `model` | *str* | :heavy_check_mark: | Model slug (e.g., "openai/gpt-4.1") | openai/gpt-4.1 |
| `model_permaslug` | *str* | :heavy_check_mark: | Model permaslug (e.g., "openai/gpt-4.1-2025-04-14") | openai/gpt-4.1-2025-04-14 |
| `endpoint_id` | *str* | :heavy_check_mark: | Unique identifier for the endpoint | 550e8400-e29b-41d4-a716-446655440000 |
| `provider_name` | *str* | :heavy_check_mark: | Name of the provider serving this endpoint | OpenAI |
| `usage` | *float* | :heavy_check_mark: | Total cost in USD (OpenRouter credits spent) | 0.015 |
| `byok_usage_inference` | *float* | :heavy_check_mark: | BYOK inference cost in USD (external credits spent) | 0.012 |
| `requests` | *float* | :heavy_check_mark: | Number of requests made | 5 |
| `prompt_tokens` | *float* | :heavy_check_mark: | Total prompt tokens used | 50 |
| `completion_tokens` | *float* | :heavy_check_mark: | Total completion tokens generated | 125 |
| `reasoning_tokens` | *float* | :heavy_check_mark: | Total reasoning tokens used | 25 |
+11
View File
@@ -0,0 +1,11 @@
# APIType
Type of API used for the generation
## Values
| Name | Value |
| ------------- | ------------- |
| `COMPLETIONS` | completions |
| `EMBEDDINGS` | embeddings |
+14
View File
@@ -0,0 +1,14 @@
# Architecture
Model architecture information
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `tokenizer` | [Nullable[models.Tokenizer]](../models/tokenizer.md) | :heavy_check_mark: | N/A | GPT |
| `instruct_type` | [Nullable[models.InstructType]](../models/instructtype.md) | :heavy_check_mark: | Instruction format type | |
| `modality` | *Nullable[str]* | :heavy_check_mark: | Primary modality of the model | text |
| `input_modalities` | List[[models.InputModality](../models/inputmodality.md)] | :heavy_check_mark: | Supported input modalities | |
| `output_modalities` | List[[models.OutputModality](../models/outputmodality.md)] | :heavy_check_mark: | Supported output modalities | |
+13
View File
@@ -0,0 +1,13 @@
# AssistantMessage
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `role` | *Literal["assistant"]* | :heavy_check_mark: | N/A |
| `content` | [OptionalNullable[models.AssistantMessageContent]](../models/assistantmessagecontent.md) | :heavy_minus_sign: | N/A |
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `tool_calls` | List[[models.ChatMessageToolCall](../models/chatmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
+17
View File
@@ -0,0 +1,17 @@
# AssistantMessageContent
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `List[models.ChatMessageContentItem]`
```python
value: List[models.ChatMessageContentItem] = /* values here */
```
@@ -0,0 +1,12 @@
# BadGatewayResponseErrorData
Error data for BadGatewayResponse
## Fields
| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `code` | *int* | :heavy_check_mark: | N/A |
| `message` | *str* | :heavy_check_mark: | N/A |
| `metadata` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
@@ -0,0 +1,12 @@
# BadRequestResponseErrorData
Error data for BadRequestResponse
## Fields
| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `code` | *int* | :heavy_check_mark: | N/A |
| `message` | *str* | :heavy_check_mark: | N/A |
| `metadata` | Dict[str, *Nullable[Any]*] | :heavy_minus_sign: | N/A |
+17
View File
@@ -0,0 +1,17 @@
# CallData
## Fields
| Field | Type | Required | Description |
| -------------------- | -------------------- | -------------------- | -------------------- |
| `deadline` | *str* | :heavy_check_mark: | N/A |
| `fee_amount` | *str* | :heavy_check_mark: | N/A |
| `id` | *str* | :heavy_check_mark: | N/A |
| `operator` | *str* | :heavy_check_mark: | N/A |
| `prefix` | *str* | :heavy_check_mark: | N/A |
| `recipient` | *str* | :heavy_check_mark: | N/A |
| `recipient_amount` | *str* | :heavy_check_mark: | N/A |
| `recipient_currency` | *str* | :heavy_check_mark: | N/A |
| `refund_destination` | *str* | :heavy_check_mark: | N/A |
| `signature` | *str* | :heavy_check_mark: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# ChainID
## Values
| Name | Value |
| --------------------------------------------- | --------------------------------------------- |
| `ONE` | 1 |
| `ONE_HUNDRED_AND_THIRTY_SEVEN` | 137 |
| `EIGHT_THOUSAND_FOUR_HUNDRED_AND_FIFTY_THREE` | 8453 |
+12
View File
@@ -0,0 +1,12 @@
# ChatCompletionFinishReason
## Values
| Name | Value |
| ---------------- | ---------------- |
| `TOOL_CALLS` | tool_calls |
| `STOP` | stop |
| `LENGTH` | length |
| `CONTENT_FILTER` | content_filter |
| `ERROR` | error |
+11
View File
@@ -0,0 +1,11 @@
# ChatErrorError
## Fields
| Field | Type | Required | Description |
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
| `code` | [Nullable[models.Code]](../models/code.md) | :heavy_check_mark: | N/A |
| `message` | *str* | :heavy_check_mark: | N/A |
| `param` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
+29
View File
@@ -0,0 +1,29 @@
# ChatGenerationParams
## Fields
| Field | 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 |
@@ -0,0 +1,8 @@
# ChatGenerationParamsResponseFormatJSONObject
## Fields
| Field | Type | Required | Description |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,8 @@
# ChatGenerationParamsResponseFormatPython
## Fields
| Field | Type | Required | Description |
| ------------------- | ------------------- | ------------------- | ------------------- |
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,8 @@
# ChatGenerationParamsResponseFormatText
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,35 @@
# ChatGenerationParamsResponseFormatUnion
## Supported Types
### `models.ChatGenerationParamsResponseFormatText`
```python
value: models.ChatGenerationParamsResponseFormatText = /* values here */
```
### `models.ChatGenerationParamsResponseFormatJSONObject`
```python
value: models.ChatGenerationParamsResponseFormatJSONObject = /* values here */
```
### `models.ResponseFormatJSONSchema`
```python
value: models.ResponseFormatJSONSchema = /* values here */
```
### `models.ResponseFormatTextGrammar`
```python
value: models.ResponseFormatTextGrammar = /* values here */
```
### `models.ChatGenerationParamsResponseFormatPython`
```python
value: models.ChatGenerationParamsResponseFormatPython = /* values here */
```
+17
View File
@@ -0,0 +1,17 @@
# ChatGenerationParamsStop
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `List[str]`
```python
value: List[str] = /* values here */
```
+12
View File
@@ -0,0 +1,12 @@
# ChatGenerationTokenUsage
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `completion_tokens` | *float* | :heavy_check_mark: | N/A |
| `prompt_tokens` | *float* | :heavy_check_mark: | N/A |
| `total_tokens` | *float* | :heavy_check_mark: | N/A |
| `completion_tokens_details` | [OptionalNullable[models.CompletionTokensDetails]](../models/completiontokensdetails.md) | :heavy_minus_sign: | N/A |
| `prompt_tokens_details` | [OptionalNullable[models.PromptTokensDetails]](../models/prompttokensdetails.md) | :heavy_minus_sign: | N/A |
+29
View File
@@ -0,0 +1,29 @@
# ChatMessageContentItem
## Supported Types
### `models.ChatMessageContentItemText`
```python
value: models.ChatMessageContentItemText = /* values here */
```
### `models.ChatMessageContentItemImage`
```python
value: models.ChatMessageContentItemImage = /* values here */
```
### `models.ChatMessageContentItemAudio`
```python
value: models.ChatMessageContentItemAudio = /* values here */
```
### `models.ChatMessageContentItemVideo`
```python
value: models.ChatMessageContentItemVideo = /* values here */
```
@@ -0,0 +1,9 @@
# ChatMessageContentItemAudio
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `type` | *Literal["input_audio"]* | :heavy_check_mark: | N/A |
| `input_audio` | [models.ChatMessageContentItemAudioInputAudio](../models/chatmessagecontentitemaudioinputaudio.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,14 @@
# ChatMessageContentItemAudioFormat
## Values
| Name | Value |
| ------- | ------- |
| `WAV` | wav |
| `MP3` | mp3 |
| `FLAC` | flac |
| `M4A` | m4a |
| `OGG` | ogg |
| `PCM16` | pcm16 |
| `PCM24` | pcm24 |
@@ -0,0 +1,9 @@
# ChatMessageContentItemAudioInputAudio
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `data` | *str* | :heavy_check_mark: | N/A |
| `format_` | [models.ChatMessageContentItemAudioFormat](../models/chatmessagecontentitemaudioformat.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,9 @@
# ChatMessageContentItemImage
## Fields
| Field | Type | Required | Description |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `type` | *Literal["image_url"]* | :heavy_check_mark: | N/A |
| `image_url` | [models.ImageURL](../models/imageurl.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,10 @@
# ChatMessageContentItemImageDetail
## Values
| Name | Value |
| ------ | ------ |
| `AUTO` | auto |
| `LOW` | low |
| `HIGH` | high |
@@ -0,0 +1,9 @@
# ChatMessageContentItemText
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
| `text` | *str* | :heavy_check_mark: | N/A |
@@ -0,0 +1,9 @@
# ChatMessageContentItemVideo
## Fields
| Field | Type | Required | Description |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `type` | *Literal["input_video"]* | :heavy_check_mark: | N/A |
| `video_url` | [models.VideoURL](../models/videourl.md) | :heavy_check_mark: | N/A |
+11
View File
@@ -0,0 +1,11 @@
# ChatMessageTokenLogprob
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
| `token` | *str* | :heavy_check_mark: | N/A |
| `logprob` | *float* | :heavy_check_mark: | N/A |
| `bytes_` | List[*float*] | :heavy_check_mark: | N/A |
| `top_logprobs` | List[[models.TopLogprob](../models/toplogprob.md)] | :heavy_check_mark: | N/A |
+9
View File
@@ -0,0 +1,9 @@
# ChatMessageTokenLogprobs
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `content` | List[[models.ChatMessageTokenLogprob](../models/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
| `refusal` | List[[models.ChatMessageTokenLogprob](../models/chatmessagetokenlogprob.md)] | :heavy_check_mark: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# ChatMessageToolCall
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `id` | *str* | :heavy_check_mark: | N/A |
| `type` | *Literal["function"]* | :heavy_check_mark: | N/A |
| `function` | [models.ChatMessageToolCallFunction](../models/chatmessagetoolcallfunction.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,9 @@
# ChatMessageToolCallFunction
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `name` | *str* | :heavy_check_mark: | N/A |
| `arguments` | *str* | :heavy_check_mark: | N/A |
+14
View File
@@ -0,0 +1,14 @@
# ChatResponse
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `id` | *str* | :heavy_check_mark: | N/A |
| `choices` | List[[models.ChatResponseChoice](../models/chatresponsechoice.md)] | :heavy_check_mark: | N/A |
| `created` | *float* | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `object` | *Literal["chat.completion"]* | :heavy_check_mark: | N/A |
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `usage` | [Optional[models.ChatGenerationTokenUsage]](../models/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
+11
View File
@@ -0,0 +1,11 @@
# ChatResponseChoice
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `finish_reason` | [Nullable[models.ChatCompletionFinishReason]](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
| `index` | *float* | :heavy_check_mark: | N/A |
| `message` | [models.AssistantMessage](../models/assistantmessage.md) | :heavy_check_mark: | N/A |
| `logprobs` | [OptionalNullable[models.ChatMessageTokenLogprobs]](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
+11
View File
@@ -0,0 +1,11 @@
# ChatStreamingChoice
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `delta` | [models.ChatStreamingMessageChunk](../models/chatstreamingmessagechunk.md) | :heavy_check_mark: | N/A |
| `finish_reason` | [Nullable[models.ChatCompletionFinishReason]](../models/chatcompletionfinishreason.md) | :heavy_check_mark: | N/A |
| `index` | *float* | :heavy_check_mark: | N/A |
| `logprobs` | [OptionalNullable[models.ChatMessageTokenLogprobs]](../models/chatmessagetokenlogprobs.md) | :heavy_minus_sign: | N/A |
+12
View File
@@ -0,0 +1,12 @@
# ChatStreamingMessageChunk
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `role` | [Optional[models.ChatStreamingMessageChunkRole]](../models/chatstreamingmessagechunkrole.md) | :heavy_minus_sign: | N/A |
| `content` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `reasoning` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `refusal` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `tool_calls` | List[[models.ChatStreamingMessageToolCall](../models/chatstreamingmessagetoolcall.md)] | :heavy_minus_sign: | N/A |
@@ -0,0 +1,8 @@
# ChatStreamingMessageChunkRole
## Values
| Name | Value |
| ----------- | ----------- |
| `ASSISTANT` | assistant |
@@ -0,0 +1,11 @@
# ChatStreamingMessageToolCall
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `index` | *float* | :heavy_check_mark: | N/A |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `type` | *Optional[Literal["function"]]* | :heavy_minus_sign: | N/A |
| `function` | [Optional[models.ChatStreamingMessageToolCallFunction]](../models/chatstreamingmessagetoolcallfunction.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,9 @@
# ChatStreamingMessageToolCallFunction
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `name` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `arguments` | *Optional[str]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,8 @@
# ChatStreamingResponseChunk
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `data` | [models.ChatStreamingResponseChunkData](../models/chatstreamingresponsechunkdata.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,15 @@
# ChatStreamingResponseChunkData
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `id` | *str* | :heavy_check_mark: | N/A |
| `choices` | List[[models.ChatStreamingChoice](../models/chatstreamingchoice.md)] | :heavy_check_mark: | N/A |
| `created` | *float* | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `object` | *Literal["chat.completion.chunk"]* | :heavy_check_mark: | N/A |
| `system_fingerprint` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A |
| `error` | [Optional[models.ChatStreamingResponseChunkError]](../models/chatstreamingresponsechunkerror.md) | :heavy_minus_sign: | N/A |
| `usage` | [Optional[models.ChatGenerationTokenUsage]](../models/chatgenerationtokenusage.md) | :heavy_minus_sign: | N/A |
@@ -0,0 +1,9 @@
# ChatStreamingResponseChunkError
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `message` | *str* | :heavy_check_mark: | N/A |
| `code` | *float* | :heavy_check_mark: | N/A |
+8
View File
@@ -0,0 +1,8 @@
# ChatStreamOptions
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `include_usage` | *Optional[bool]* | :heavy_minus_sign: | N/A |
+17
View File
@@ -0,0 +1,17 @@
# Code
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `float`
```python
value: float = /* values here */
```
+25
View File
@@ -0,0 +1,25 @@
# CodeEnum
## Values
| Name | Value |
| -------------------------------- | -------------------------------- |
| `SERVER_ERROR` | server_error |
| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded |
| `INVALID_PROMPT` | invalid_prompt |
| `VECTOR_STORE_TIMEOUT` | vector_store_timeout |
| `INVALID_IMAGE` | invalid_image |
| `INVALID_IMAGE_FORMAT` | invalid_image_format |
| `INVALID_BASE64_IMAGE` | invalid_base64_image |
| `INVALID_IMAGE_URL` | invalid_image_url |
| `IMAGE_TOO_LARGE` | image_too_large |
| `IMAGE_TOO_SMALL` | image_too_small |
| `IMAGE_PARSE_ERROR` | image_parse_error |
| `IMAGE_CONTENT_POLICY_VIOLATION` | image_content_policy_violation |
| `INVALID_IMAGE_MODE` | invalid_image_mode |
| `IMAGE_FILE_TOO_LARGE` | image_file_too_large |
| `UNSUPPORTED_IMAGE_MEDIA_TYPE` | unsupported_image_media_type |
| `EMPTY_IMAGE_FILE` | empty_image_file |
| `FAILED_TO_DOWNLOAD_IMAGE` | failed_to_download_image |
| `IMAGE_FILE_NOT_FOUND` | image_file_not_found |
+11
View File
@@ -0,0 +1,11 @@
# CompletionChoice
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| `text` | *str* | :heavy_check_mark: | N/A |
| `index` | *float* | :heavy_check_mark: | N/A |
| `logprobs` | [Nullable[models.CompletionLogprobs]](../models/completionlogprobs.md) | :heavy_check_mark: | N/A |
| `finish_reason` | [Nullable[models.CompletionFinishReason]](../models/completionfinishreason.md) | :heavy_check_mark: | N/A |
+28
View File
@@ -0,0 +1,28 @@
# CompletionCreateParams
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `model` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `models` | List[*str*] | :heavy_minus_sign: | N/A |
| `prompt` | [models.Prompt](../models/prompt.md) | :heavy_check_mark: | 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 |
@@ -0,0 +1,8 @@
# CompletionCreateParamsResponseFormatJSONObject
## Fields
| Field | Type | Required | Description |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `type` | *Literal["json_object"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,8 @@
# CompletionCreateParamsResponseFormatPython
## Fields
| Field | Type | Required | Description |
| ------------------- | ------------------- | ------------------- | ------------------- |
| `type` | *Literal["python"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,8 @@
# CompletionCreateParamsResponseFormatText
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `type` | *Literal["text"]* | :heavy_check_mark: | N/A |
@@ -0,0 +1,35 @@
# CompletionCreateParamsResponseFormatUnion
## Supported Types
### `models.CompletionCreateParamsResponseFormatText`
```python
value: models.CompletionCreateParamsResponseFormatText = /* values here */
```
### `models.CompletionCreateParamsResponseFormatJSONObject`
```python
value: models.CompletionCreateParamsResponseFormatJSONObject = /* values here */
```
### `models.ResponseFormatJSONSchema`
```python
value: models.ResponseFormatJSONSchema = /* values here */
```
### `models.ResponseFormatTextGrammar`
```python
value: models.ResponseFormatTextGrammar = /* values here */
```
### `models.CompletionCreateParamsResponseFormatPython`
```python
value: models.CompletionCreateParamsResponseFormatPython = /* values here */
```
+17
View File
@@ -0,0 +1,17 @@
# CompletionCreateParamsStop
## Supported Types
### `str`
```python
value: str = /* values here */
```
### `List[str]`
```python
value: List[str] = /* values here */
```
+10
View File
@@ -0,0 +1,10 @@
# CompletionFinishReason
## Values
| Name | Value |
| ---------------- | ---------------- |
| `STOP` | stop |
| `LENGTH` | length |
| `CONTENT_FILTER` | content_filter |
+11
View File
@@ -0,0 +1,11 @@
# CompletionLogprobs
## Fields
| Field | Type | Required | Description |
| ------------------------ | ------------------------ | ------------------------ | ------------------------ |
| `tokens` | List[*str*] | :heavy_check_mark: | N/A |
| `token_logprobs` | List[*float*] | :heavy_check_mark: | N/A |
| `top_logprobs` | List[Dict[str, *float*]] | :heavy_check_mark: | N/A |
| `text_offset` | List[*float*] | :heavy_check_mark: | N/A |
+14
View File
@@ -0,0 +1,14 @@
# CompletionResponse
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `id` | *str* | :heavy_check_mark: | N/A |
| `object` | *Literal["text_completion"]* | :heavy_check_mark: | N/A |
| `created` | *float* | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `system_fingerprint` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `choices` | List[[models.CompletionChoice](../models/completionchoice.md)] | :heavy_check_mark: | N/A |
| `usage` | [Optional[models.CompletionUsage]](../models/completionusage.md) | :heavy_minus_sign: | N/A |
+11
View File
@@ -0,0 +1,11 @@
# CompletionTokensDetails
## Fields
| Field | Type | Required | Description |
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
| `reasoning_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `audio_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `accepted_prediction_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `rejected_prediction_tokens` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# CompletionUsage
## Fields
| Field | Type | Required | Description |
| ------------------- | ------------------- | ------------------- | ------------------- |
| `prompt_tokens` | *float* | :heavy_check_mark: | N/A |
| `completion_tokens` | *float* | :heavy_check_mark: | N/A |
| `total_tokens` | *float* | :heavy_check_mark: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# CostDetails
## Fields
| Field | Type | Required | Description |
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
| `upstream_inference_cost` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `upstream_inference_input_cost` | *float* | :heavy_check_mark: | N/A |
| `upstream_inference_output_cost` | *float* | :heavy_check_mark: | N/A |
@@ -0,0 +1,11 @@
# CreateAuthKeysCodeCodeChallengeMethod
The method used to generate the code challenge
## Values
| Name | Value |
| ------- | ------- |
| `S256` | S256 |
| `PLAIN` | plain |
+12
View File
@@ -0,0 +1,12 @@
# CreateAuthKeysCodeData
Auth code data
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `id` | *str* | :heavy_check_mark: | The authorization code ID to use in the exchange request | auth_code_xyz789 |
| `app_id` | *float* | :heavy_check_mark: | The application ID associated with this auth code | 12345 |
| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the auth code was created | 2025-08-24T10:30:00Z |
+12
View File
@@ -0,0 +1,12 @@
# CreateAuthKeysCodeRequest
## 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[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 | |
+10
View File
@@ -0,0 +1,10 @@
# CreateAuthKeysCodeResponse
Successfully created authorization code
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `data` | [models.CreateAuthKeysCodeData](../models/createauthkeyscodedata.md) | :heavy_check_mark: | Auth code data | {<br/>"id": "auth_code_xyz789",<br/>"app_id": 12345,<br/>"created_at": "2025-08-24T10:30:00Z"<br/>} |
+12
View File
@@ -0,0 +1,12 @@
# CreateChargeRequest
Create a Coinbase charge for crypto payment
## Fields
| Field | Type | Required | Description |
| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- |
| `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 |
+11
View File
@@ -0,0 +1,11 @@
# CreateCoinbaseChargeData
## Fields
| Field | Type | Required | Description |
| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
| `id` | *str* | :heavy_check_mark: | N/A |
| `created_at` | *str* | :heavy_check_mark: | N/A |
| `expires_at` | *str* | :heavy_check_mark: | N/A |
| `web3_data` | [models.Web3Data](../models/web3data.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,10 @@
# CreateCoinbaseChargeResponse
Returns the calldata to fulfill the transaction
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| `data` | [models.CreateCoinbaseChargeData](../models/createcoinbasechargedata.md) | :heavy_check_mark: | N/A |
@@ -0,0 +1,8 @@
# CreateCoinbaseChargeSecurity
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `bearer` | *str* | :heavy_check_mark: | N/A |
+10
View File
@@ -0,0 +1,10 @@
# CreateEmbeddingsData
## Fields
| Field | Type | Required | Description |
| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
| `object` | [models.ObjectEmbedding](../models/objectembedding.md) | :heavy_check_mark: | N/A |
| `embedding` | [models.Embedding](../models/embedding.md) | :heavy_check_mark: | N/A |
| `index` | *Optional[float]* | :heavy_minus_sign: | N/A |
@@ -0,0 +1,14 @@
# CreateEmbeddingsDataCollection
Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
## Values
| Name | Value |
| ------- | ------- |
| `DENY` | deny |
| `ALLOW` | allow |
+17
View File
@@ -0,0 +1,17 @@
# CreateEmbeddingsIgnore
## Supported Types
### `models.ProviderName`
```python
value: models.ProviderName = /* values here */
```
### `str`
```python
value: str = /* values here */
```
+14
View File
@@ -0,0 +1,14 @@
# CreateEmbeddingsMaxPrice
The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| `prompt` | *Optional[Any]* | :heavy_minus_sign: | A value in string or number format that is a large number |
| `completion` | *Optional[Any]* | :heavy_minus_sign: | A value in string or number format that is a large number |
| `image` | *Optional[Any]* | :heavy_minus_sign: | A value in string or number format that is a large number |
| `audio` | *Optional[Any]* | :heavy_minus_sign: | A value in string or number format that is a large number |
| `request` | *Optional[Any]* | :heavy_minus_sign: | A value in string or number format that is a large number |
+8
View File
@@ -0,0 +1,8 @@
# CreateEmbeddingsObject
## Values
| Name | Value |
| ------ | ------ |
| `LIST` | list |
+17
View File
@@ -0,0 +1,17 @@
# CreateEmbeddingsOnly
## Supported Types
### `models.ProviderName`
```python
value: models.ProviderName = /* values here */
```
### `str`
```python
value: str = /* values here */
```
+17
View File
@@ -0,0 +1,17 @@
# CreateEmbeddingsOrder
## Supported Types
### `models.ProviderName`
```python
value: models.ProviderName = /* values here */
```
### `str`
```python
value: str = /* values here */
```
+18
View File
@@ -0,0 +1,18 @@
# CreateEmbeddingsProvider
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_fallbacks` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to allow backup providers to serve requests<br/>- true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider.<br/>- false: use only the primary/custom provider, and return the upstream error if it's unavailable.<br/> | |
| `require_parameters` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. | |
| `data_collection` | [OptionalNullable[models.CreateEmbeddingsDataCollection]](../models/createembeddingsdatacollection.md) | :heavy_minus_sign: | Data collection setting. If no available model provider meets the requirement, your request will return an error.<br/>- allow: (default) allow providers which store user data non-transiently and may train on it<br/>- deny: use only providers which do not collect user data.<br/> | deny |
| `zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used. | true |
| `enforce_distillable_text` | *OptionalNullable[bool]* | :heavy_minus_sign: | Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used. | true |
| `order` | List[[models.CreateEmbeddingsOrder](../models/createembeddingsorder.md)] | :heavy_minus_sign: | An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message. | |
| `only` | List[[models.CreateEmbeddingsOnly](../models/createembeddingsonly.md)] | :heavy_minus_sign: | List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request. | |
| `ignore` | List[[models.CreateEmbeddingsIgnore](../models/createembeddingsignore.md)] | :heavy_minus_sign: | List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request. | |
| `quantizations` | List[[models.Quantization](../models/quantization.md)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
| `sort` | [OptionalNullable[models.CreateEmbeddingsSort]](../models/createembeddingssort.md) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
| `max_price` | [Optional[models.CreateEmbeddingsMaxPrice]](../models/createembeddingsmaxprice.md) | :heavy_minus_sign: | The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. | |
+12
View File
@@ -0,0 +1,12 @@
# CreateEmbeddingsRequest
## Fields
| Field | 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 |
+17
View File
@@ -0,0 +1,17 @@
# CreateEmbeddingsResponse
## Supported Types
### `models.CreateEmbeddingsResponseBody`
```python
value: models.CreateEmbeddingsResponseBody = /* values here */
```
### `str`
```python
value: str = /* values here */
```
@@ -0,0 +1,14 @@
# CreateEmbeddingsResponseBody
Embedding response
## Fields
| Field | Type | Required | Description |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `id` | *Optional[str]* | :heavy_minus_sign: | N/A |
| `object` | [models.CreateEmbeddingsObject](../models/createembeddingsobject.md) | :heavy_check_mark: | N/A |
| `data` | List[[models.CreateEmbeddingsData](../models/createembeddingsdata.md)] | :heavy_check_mark: | N/A |
| `model` | *str* | :heavy_check_mark: | N/A |
| `usage` | [Optional[models.Usage]](../models/usage.md) | :heavy_minus_sign: | N/A |
+12
View File
@@ -0,0 +1,12 @@
# CreateEmbeddingsSort
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
## Values
| Name | Value |
| ------------ | ------------ |
| `PRICE` | price |
| `THROUGHPUT` | throughput |
| `LATENCY` | latency |
+28
View File
@@ -0,0 +1,28 @@
# CreateKeysData
The created API key information
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `hash` | *str* | :heavy_check_mark: | Unique hash identifier for the API key | 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 |
| `name` | *str* | :heavy_check_mark: | Name of the API key | My Production Key |
| `label` | *str* | :heavy_check_mark: | Human-readable label for the API key | Production API Key |
| `disabled` | *bool* | :heavy_check_mark: | Whether the API key is disabled | false |
| `limit` | *Nullable[float]* | :heavy_check_mark: | Spending limit for the API key in USD | 100 |
| `limit_remaining` | *Nullable[float]* | :heavy_check_mark: | Remaining spending limit in USD | 74.5 |
| `limit_reset` | *Nullable[str]* | :heavy_check_mark: | Type of limit reset for the API key | monthly |
| `include_byok_in_limit` | *bool* | :heavy_check_mark: | Whether to include external BYOK usage in the credit limit | false |
| `usage` | *float* | :heavy_check_mark: | Total OpenRouter credit usage (in USD) for the API key | 25.5 |
| `usage_daily` | *float* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC day | 25.5 |
| `usage_weekly` | *float* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday) | 25.5 |
| `usage_monthly` | *float* | :heavy_check_mark: | OpenRouter credit usage (in USD) for the current UTC month | 25.5 |
| `byok_usage` | *float* | :heavy_check_mark: | Total external BYOK usage (in USD) for the API key | 17.38 |
| `byok_usage_daily` | *float* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC day | 17.38 |
| `byok_usage_weekly` | *float* | :heavy_check_mark: | External BYOK usage (in USD) for the current UTC week (Monday-Sunday) | 17.38 |
| `byok_usage_monthly` | *float* | :heavy_check_mark: | External BYOK usage (in USD) for current UTC month | 17.38 |
| `created_at` | *str* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was created | 2025-08-24T10:30:00Z |
| `updated_at` | *Nullable[str]* | :heavy_check_mark: | ISO 8601 timestamp of when the API key was last updated | 2025-08-24T15:45:00Z |
| `expires_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | ISO 8601 UTC timestamp when the API key expires, or null if no expiration | 2027-12-31T23:59:59Z |
+12
View File
@@ -0,0 +1,12 @@
# CreateKeysLimitReset
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.
## Values
| Name | Value |
| --------- | --------- |
| `DAILY` | daily |
| `WEEKLY` | weekly |
| `MONTHLY` | monthly |
+12
View File
@@ -0,0 +1,12 @@
# CreateKeysRequest
## 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[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 |
| `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 |
+11
View File
@@ -0,0 +1,11 @@
# CreateKeysResponse
API key created successfully
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | [models.CreateKeysData](../models/createkeysdata.md) | :heavy_check_mark: | The created API key information | {<br/>"hash": "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",<br/>"name": "My Production Key",<br/>"label": "Production API Key",<br/>"disabled": false,<br/>"limit": 100,<br/>"limit_remaining": 74.5,<br/>"limit_reset": "monthly",<br/>"include_byok_in_limit": false,<br/>"usage": 25.5,<br/>"usage_daily": 25.5,<br/>"usage_weekly": 25.5,<br/>"usage_monthly": 25.5,<br/>"byok_usage": 17.38,<br/>"byok_usage_daily": 17.38,<br/>"byok_usage_weekly": 17.38,<br/>"byok_usage_monthly": 17.38,<br/>"created_at": "2025-08-24T10:30:00Z",<br/>"updated_at": "2025-08-24T15:45:00Z",<br/>"expires_at": "2027-12-31T23:59:59Z"<br/>} |
| `key` | *str* | :heavy_check_mark: | The actual API key string (only shown once) | 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 |
+17
View File
@@ -0,0 +1,17 @@
# CreateResponsesResponse
## Supported Types
### `models.OpenResponsesNonStreamingResponse`
```python
value: models.OpenResponsesNonStreamingResponse = /* values here */
```
### `Union[eventstreaming.EventStream[models.CreateResponsesResponseBody], eventstreaming.EventStreamAsync[models.CreateResponsesResponseBody]]`
```python
value: Union[eventstreaming.EventStream[models.CreateResponsesResponseBody], eventstreaming.EventStreamAsync[models.CreateResponsesResponseBody]] = /* values here */
```
@@ -0,0 +1,10 @@
# CreateResponsesResponseBody
Successful response
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data` | [models.OpenResponsesStreamEvent](../models/openresponsesstreamevent.md) | :heavy_check_mark: | Union of all possible event types emitted during response streaming | {<br/>"type": "response.created",<br/>"response": {<br/>"id": "resp-abc123",<br/>"object": "response",<br/>"created_at": 1704067200,<br/>"model": "gpt-4",<br/>"status": "in_progress",<br/>"output": [],<br/>"tools": [],<br/>"tool_choice": "auto",<br/>"parallel_tool_calls": true,<br/>"error": null,<br/>"incomplete_details": null,<br/>"metadata": null,<br/>"instructions": null,<br/>"temperature": null,<br/>"top_p": null,<br/>"max_output_tokens": null<br/>},<br/>"sequence_number": 0<br/>} |
+14
View File
@@ -0,0 +1,14 @@
# DataCollection
Data collection setting. If no available model provider meets the requirement, your request will return an error.
- allow: (default) allow providers which store user data non-transiently and may train on it
- deny: use only providers which do not collect user data.
## Values
| Name | Value |
| ------- | ------- |
| `DENY` | deny |
| `ALLOW` | allow |
+12
View File
@@ -0,0 +1,12 @@
# DefaultParameters
Default parameters for this model
## Fields
| Field | Type | Required | Description |
| ------------------------- | ------------------------- | ------------------------- | ------------------------- |
| `temperature` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `top_p` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
| `frequency_penalty` | *OptionalNullable[float]* | :heavy_minus_sign: | N/A |
+8
View File
@@ -0,0 +1,8 @@
# DeleteKeysRequest
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `hash` | *str* | :heavy_check_mark: | The hash identifier of the API key to delete | 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 |

Some files were not shown because too many files have changed in this diff Show More