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
+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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 |
+10
View File
@@ -0,0 +1,10 @@
# DeleteKeysResponse
API key deleted successfully
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| `deleted` | *Literal[True]* | :heavy_check_mark: | Confirmation that the API key was deleted | true |
@@ -0,0 +1,12 @@
# EdgeNetworkTimeoutResponseErrorData
Error data for EdgeNetworkTimeoutResponse
## 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 |
+11
View File
@@ -0,0 +1,11 @@
# Effort
## Values
| Name | Value |
| --------- | --------- |
| `MINIMAL` | minimal |
| `LOW` | low |
| `MEDIUM` | medium |
| `HIGH` | high |
+17
View File
@@ -0,0 +1,17 @@
# Embedding
## Supported Types
### `List[float]`
```python
value: List[float] = /* values here */
```
### `str`
```python
value: str = /* values here */
```
+17
View File
@@ -0,0 +1,17 @@
# EncodingFormat
## Supported Types
### `models.EncodingFormatFloat`
```python
value: models.EncodingFormatFloat = /* values here */
```
### `models.EncodingFormatBase64`
```python
value: models.EncodingFormatBase64 = /* values here */
```
+8
View File
@@ -0,0 +1,8 @@
# EncodingFormatBase64
## Values
| Name | Value |
| -------- | -------- |
| `BASE64` | base64 |
+8
View File
@@ -0,0 +1,8 @@
# EncodingFormatFloat
## Values
| Name | Value |
| ------- | ------- |
| `FLOAT` | float |
@@ -0,0 +1,10 @@
# EndpointsListEndpointsResponse
Returns a list of endpoints
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `data` | [models.ListEndpointsResponse](../models/listendpointsresponse.md) | :heavy_check_mark: | List of available endpoints for a model | {<br/>"id": "openai/gpt-4",<br/>"name": "GPT-4",<br/>"created": 1692901234,<br/>"description": "GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.",<br/>"architecture": {<br/>"tokenizer": "GPT",<br/>"instruct_type": "chatml",<br/>"modality": "text-\u003etext",<br/>"input_modalities": [<br/>"text"<br/>],<br/>"output_modalities": [<br/>"text"<br/>]<br/>},<br/>"endpoints": [<br/>{<br/>"name": "OpenAI: GPT-4",<br/>"model_name": "GPT-4",<br/>"context_length": 8192,<br/>"pricing": {<br/>"prompt": "0.00003",<br/>"completion": "0.00006",<br/>"request": "0",<br/>"image": "0"<br/>},<br/>"provider_name": "OpenAI",<br/>"tag": "openai",<br/>"quantization": "fp16",<br/>"max_completion_tokens": 4096,<br/>"max_prompt_tokens": 8192,<br/>"supported_parameters": [<br/>"temperature",<br/>"top_p",<br/>"max_tokens",<br/>"frequency_penalty",<br/>"presence_penalty"<br/>],<br/>"status": "default",<br/>"uptime_last_30m": 99.5,<br/>"supports_implicit_caching": true<br/>}<br/>]<br/>} |
+13
View File
@@ -0,0 +1,13 @@
# EndpointStatus
## Values
| Name | Value |
| ---------- | ---------- |
| `ZERO` | 0 |
| `MINUS_1` | -1 |
| `MINUS_2` | -2 |
| `MINUS_3` | -3 |
| `MINUS_5` | -5 |
| `MINUS_10` | -10 |
+9
View File
@@ -0,0 +1,9 @@
# Engine
## Values
| Name | Value |
| -------- | -------- |
| `NATIVE` | native |
| `EXA` | exa |
@@ -0,0 +1,11 @@
# ExchangeAuthCodeForAPIKeyCodeChallengeMethod
The method used to generate the code challenge
## Values
| Name | Value |
| ------- | ------- |
| `S256` | S256 |
| `PLAIN` | plain |
@@ -0,0 +1,10 @@
# ExchangeAuthCodeForAPIKeyRequest
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `code` | *str* | :heavy_check_mark: | The authorization code received from the OAuth redirect | auth_code_abc123def456 |
| `code_verifier` | *Optional[str]* | :heavy_minus_sign: | The code verifier if code_challenge was used in the authorization request | dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk |
| `code_challenge_method` | [OptionalNullable[models.ExchangeAuthCodeForAPIKeyCodeChallengeMethod]](../models/exchangeauthcodeforapikeycodechallengemethod.md) | :heavy_minus_sign: | The method used to generate the code challenge | S256 |
@@ -0,0 +1,11 @@
# ExchangeAuthCodeForAPIKeyResponse
Successfully exchanged code for an API key
## Fields
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `key` | *str* | :heavy_check_mark: | The API key to use for OpenRouter requests | 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 |
| `user_id` | *Nullable[str]* | :heavy_check_mark: | User ID associated with the API key | user_2yOPcMpKoQhcd4bVgSMlELRaIah |
+11
View File
@@ -0,0 +1,11 @@
# FileCitation
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `type` | [models.FileCitationType](../models/filecitationtype.md) | :heavy_check_mark: | N/A |
| `file_id` | *str* | :heavy_check_mark: | N/A |
| `filename` | *str* | :heavy_check_mark: | N/A |
| `index` | *float* | :heavy_check_mark: | N/A |
+8
View File
@@ -0,0 +1,8 @@
# FileCitationType
## Values
| Name | Value |
| --------------- | --------------- |
| `FILE_CITATION` | file_citation |

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