mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-29 11:23:49 +08:00
chore: 🐝 Update SDK - Generate (spec change merged) 0.11.7 (#402)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev> Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
speakeasybot
speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
parent
2c673c0ca3
commit
d81cd563db
@@ -12,6 +12,6 @@ Text-to-speech request input
|
||||
| `input` | *str* | :heavy_check_mark: | Text to synthesize | Hello world |
|
||||
| `model` | *str* | :heavy_check_mark: | TTS model identifier | elevenlabs/eleven-turbo-v2 |
|
||||
| `provider` | [Optional[components.SpeechRequestProvider]](../components/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `response_format` | [Optional[components.ResponseFormatEnum]](../components/responseformatenum.mdx) | :heavy_minus_sign: | Audio output format | pcm |
|
||||
| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../components/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm |
|
||||
| `speed` | *Optional[float]* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 |
|
||||
| `voice` | *str* | :heavy_check_mark: | Voice identifier (provider-specific). | alloy |
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "ResponseFormatEnum"
|
||||
title: "SpeechRequestResponseFormat"
|
||||
---
|
||||
|
||||
Audio output format
|
||||
@@ -7,10 +7,10 @@ Audio output format
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.components import ResponseFormatEnum
|
||||
from openrouter.components import SpeechRequestResponseFormat
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: ResponseFormatEnum = "mp3"
|
||||
value: SpeechRequestResponseFormat = "mp3"
|
||||
```
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@ Speech-to-text request input. Accepts a JSON body with input_audio containing ba
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| `input_audio` | [components.STTInputAudio](../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{<br/>"data": "UklGRiQA...",<br/>"format": "wav"<br/>} |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
|
||||
| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 |
|
||||
| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `input_audio` | [components.STTInputAudio](../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{<br/>"data": "UklGRiQA...",<br/>"format": "wav"<br/>} |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
|
||||
| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 |
|
||||
| `provider` | [Optional[components.STTRequestProvider]](../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `response_format` | [Optional[components.STTRequestResponseFormat]](../components/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 |
|
||||
| `timestamp_granularities` | List[[components.STTTimestampGranularity](../components/stttimestampgranularity.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [<br/>"segment"<br/>] |
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "STTRequestResponseFormat"
|
||||
---
|
||||
|
||||
Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.components import STTRequestResponseFormat
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: STTRequestResponseFormat = "json"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"json"`
|
||||
- `"verbose_json"`
|
||||
@@ -9,5 +9,10 @@ STT response containing transcribed text and optional usage statistics
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `duration` | *Optional[float]* | :heavy_minus_sign: | Duration of the input audio in seconds, present when response_format is verbose_json | 9.2 |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | Detected or forced language, present when response_format is verbose_json | english |
|
||||
| `segments` | List[[components.STTSegment](../components/sttsegment.mdx)] | :heavy_minus_sign: | Timestamped transcript segments, present when response_format is verbose_json | |
|
||||
| `task` | *Optional[str]* | :heavy_minus_sign: | The task performed, present when response_format is verbose_json | transcribe |
|
||||
| `text` | *str* | :heavy_check_mark: | The transcribed text | Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. |
|
||||
| `usage` | [Optional[components.STTUsage]](../components/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{<br/>"cost": 0.000508,<br/>"input_tokens": 83,<br/>"output_tokens": 30,<br/>"seconds": 9.2,<br/>"total_tokens": 113<br/>} |
|
||||
| `usage` | [Optional[components.STTUsage]](../components/sttusage.mdx) | :heavy_minus_sign: | Aggregated usage statistics for the request | \{<br/>"cost": 0.000508,<br/>"input_tokens": 83,<br/>"output_tokens": 30,<br/>"seconds": 9.2,<br/>"total_tokens": 113<br/>} |
|
||||
| `words` | List[[components.STTWord](../components/sttword.mdx)] | :heavy_minus_sign: | Timestamped words, present when the provider returns word-level timestamps | |
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "STTSegment"
|
||||
---
|
||||
|
||||
A timestamped transcript segment, returned when response_format is verbose_json
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ |
|
||||
| `avg_logprob` | *Optional[float]* | :heavy_minus_sign: | Average log probability of the segment | |
|
||||
| `compression_ratio` | *Optional[float]* | :heavy_minus_sign: | Compression ratio of the segment | |
|
||||
| `end` | *float* | :heavy_check_mark: | Segment end time in seconds | 3.2 |
|
||||
| `id` | *int* | :heavy_check_mark: | Segment index within the transcript | 0 |
|
||||
| `no_speech_prob` | *Optional[float]* | :heavy_minus_sign: | Probability the segment contains no speech | |
|
||||
| `seek` | *Optional[int]* | :heavy_minus_sign: | Seek offset of the segment | 0 |
|
||||
| `start` | *float* | :heavy_check_mark: | Segment start time in seconds | 0 |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Temperature used for the segment | |
|
||||
| `text` | *str* | :heavy_check_mark: | Transcribed text of the segment | Hello there. |
|
||||
| `tokens` | List[*int*] | :heavy_minus_sign: | Token IDs of the segment | |
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "STTTimestampGranularity"
|
||||
---
|
||||
|
||||
A timestamp detail level for verbose_json transcription responses.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.components import STTTimestampGranularity
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: STTTimestampGranularity = "word"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"word"`
|
||||
- `"segment"`
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
title: "STTWord"
|
||||
---
|
||||
|
||||
A timestamped word, returned when the provider includes word-level timestamps
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| -------------------------- | -------------------------- | -------------------------- | -------------------------- | -------------------------- |
|
||||
| `end` | *float* | :heavy_check_mark: | Word end time in seconds | 0.4 |
|
||||
| `start` | *float* | :heavy_check_mark: | Word start time in seconds | 0 |
|
||||
| `word` | *str* | :heavy_check_mark: | The transcribed word | Hello |
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "ContextBucket"
|
||||
---
|
||||
|
||||
Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import ContextBucket
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: ContextBucket = "1K"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"1K"`
|
||||
- `"10K"`
|
||||
- `"100K"`
|
||||
- `"1M"`
|
||||
- `"10M"`
|
||||
@@ -4,10 +4,11 @@ title: "CreateAudioTranscriptionsMultipartRequestBody"
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). |
|
||||
| `model` | *str* | :heavy_check_mark: | The model to use for transcription. |
|
||||
| `response_format` | [Optional[operations.ResponseFormat]](../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. Only "json" is supported. |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. |
|
||||
| Field | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). |
|
||||
| `model` | *str* | :heavy_check_mark: | The model to use for transcription. |
|
||||
| `response_format` | [Optional[operations.ResponseFormat]](../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. |
|
||||
| `timestamp_granularities` | List[[operations.TimestampGranularities](../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. |
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "GetRankingsDailyCategory"
|
||||
---
|
||||
|
||||
Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import GetRankingsDailyCategory
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: GetRankingsDailyCategory = "programming"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"programming"`
|
||||
- `"roleplay"`
|
||||
- `"marketing"`
|
||||
- `"marketing/seo"`
|
||||
- `"technology"`
|
||||
- `"science"`
|
||||
- `"translation"`
|
||||
- `"legal"`
|
||||
- `"finance"`
|
||||
- `"health"`
|
||||
- `"trivia"`
|
||||
- `"academia"`
|
||||
@@ -4,10 +4,15 @@ title: "GetRankingsDailyRequest"
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 |
|
||||
| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 |
|
||||
| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 |
|
||||
| `period` | [Optional[operations.Period]](../operations/period.mdx) | :heavy_minus_sign: | Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. | day |
|
||||
| `modality` | [Optional[operations.Modality]](../operations/modality.mdx) | :heavy_minus_sign: | Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. | text |
|
||||
| `context_bucket` | [Optional[operations.ContextBucket]](../operations/contextbucket.mdx) | :heavy_minus_sign: | Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. | 100K |
|
||||
| `category` | [Optional[operations.GetRankingsDailyCategory]](../operations/getrankingsdailycategory.mdx) | :heavy_minus_sign: | Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. | programming |
|
||||
| `language_type` | [Optional[operations.LanguageType]](../operations/languagetype.mdx) | :heavy_minus_sign: | Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. | natural |
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "LanguageType"
|
||||
---
|
||||
|
||||
Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import LanguageType
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: LanguageType = "natural"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"natural"`
|
||||
- `"programming"`
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "Modality"
|
||||
---
|
||||
|
||||
Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import Modality
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: Modality = "text"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"text"`
|
||||
- `"image"`
|
||||
- `"image_output"`
|
||||
- `"audio"`
|
||||
- `"tool_calling"`
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: "Period"
|
||||
---
|
||||
|
||||
Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import Period
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: Period = "day"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"day"`
|
||||
- `"week"`
|
||||
- `"month"`
|
||||
@@ -2,16 +2,21 @@
|
||||
title: "ResponseFormat"
|
||||
---
|
||||
|
||||
The response format. Only "json" is supported.
|
||||
The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import ResponseFormat
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: ResponseFormat = "json"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"json"`
|
||||
- `"verbose_json"`
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "TimestampGranularities"
|
||||
---
|
||||
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
from openrouter.operations import TimestampGranularities
|
||||
|
||||
# Open enum: unrecognized values are captured as UnrecognizedStr
|
||||
value: TimestampGranularities = "word"
|
||||
```
|
||||
|
||||
|
||||
## Values
|
||||
|
||||
This is an open enum. Unrecognized values will not fail type checks.
|
||||
|
||||
- `"word"`
|
||||
- `"segment"`
|
||||
@@ -102,6 +102,13 @@ Each row is a distinct `(date, model_permaslug)` pair. The `other` row uses the
|
||||
reserved permaslug `other` and is always returned last within its date, so callers
|
||||
can compute `top-50 traffic / total daily traffic` without a second request.
|
||||
|
||||
Optional filters slice the dataset. `period` (`day`/`week`/`month`) sets the time
|
||||
grain. `modality` and `context_bucket` narrow the exact dataset by output/input
|
||||
modality (or tool-calling activity) and request context length. `category` and
|
||||
`language_type` instead read a sampled, upsampled dataset whose `total_tokens` are
|
||||
weekly-grain estimates — they cannot be combined with each other or with the exact
|
||||
filters, and reject `period=day` with a 400.
|
||||
|
||||
Authenticate with any valid OpenRouter API key (same key used for inference).
|
||||
Rate-limited to 30 requests/minute per key and 500 requests/day per account.
|
||||
|
||||
@@ -136,14 +143,19 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 |
|
||||
| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `start_date` | *Optional[str]* | :heavy_minus_sign: | Start of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to 30 days before `end_date`. The dataset begins at 2025-01-01; earlier values are clamped forward to that floor and the resolved value is echoed in `meta.start_date`. | 2026-04-12 |
|
||||
| `end_date` | *Optional[str]* | :heavy_minus_sign: | End of the date window in YYYY-MM-DD (UTC), inclusive. Defaults to the most recent completed UTC day. Must be on or after 2025-01-01; earlier values are rejected with a 400. | 2026-05-11 |
|
||||
| `period` | [Optional[operations.Period]](../../operations/period.mdx) | :heavy_minus_sign: | Time grain of each row. `day` (default) returns the per-UTC-day series; `week` buckets by ISO week start; `month` buckets by month start. With `category` or `language_type` only `week` (default) and `month` are available — `day` is rejected with a 400 because those datasets are aggregated weekly. For those sampled datasets `period=month` buckets each week by its week-start month, so totals are approximate at month boundaries. | day |
|
||||
| `modality` | [Optional[operations.Modality]](../../operations/modality.mdx) | :heavy_minus_sign: | Restrict to models for a modality surface: `text` / `image_output` match output modality, `image` / `audio` match input modality, and `tool_calling` keeps only rows that recorded at least one tool call. Exact dataset — cannot be combined with `category` or `language_type`. | text |
|
||||
| `context_bucket` | [Optional[operations.ContextBucket]](../../operations/contextbucket.mdx) | :heavy_minus_sign: | Restrict to requests whose context length falls in this bucket (`1K`, `10K`, `100K`, `1M`, or `10M`). Exact dataset — cannot be combined with `category` or `language_type`. | 100K |
|
||||
| `category` | [Optional[operations.GetRankingsDailyCategory]](../../operations/getrankingsdailycategory.mdx) | :heavy_minus_sign: | Restrict to a use-case category (e.g. `programming`, `roleplay`). Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `language_type`. | programming |
|
||||
| `language_type` | [Optional[operations.LanguageType]](../../operations/languagetype.mdx) | :heavy_minus_sign: | Restrict to natural-language or programming-language tagged activity. Sourced from a sampled, upsampled dataset, so `total_tokens` is an estimate and is aggregated weekly (the trailing weekly bucket may include traffic past `end_date`). Cannot be combined with `modality`, `context_bucket`, or `category`. | natural |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
+25
-22
@@ -42,17 +42,19 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `input_audio` | [components.STTInputAudio](../../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{<br/>"data": "UklGRiQA...",<br/>"format": "wav"<br/>} |
|
||||
| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
|
||||
| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `input_audio` | [components.STTInputAudio](../../components/sttinputaudio.mdx) | :heavy_check_mark: | Base64-encoded audio to transcribe | \{<br/>"data": "UklGRiQA...",<br/>"format": "wav"<br/>} |
|
||||
| `model` | *str* | :heavy_check_mark: | STT model identifier | openai/whisper-large-v3 |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> | |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
|
||||
| `provider` | [Optional[components.STTRequestProvider]](../../components/sttrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `response_format` | [Optional[components.STTRequestResponseFormat]](../../components/sttrequestresponseformat.mdx) | :heavy_minus_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | Sampling temperature for transcription | 0 |
|
||||
| `timestamp_granularities` | List[[components.STTTimestampGranularity](../../components/stttimestampgranularity.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json". | [<br/>"segment"<br/>] |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
### Response
|
||||
|
||||
@@ -104,17 +106,18 @@ with OpenRouter(
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. |
|
||||
| `model` | *str* | :heavy_check_mark: | The model to use for transcription. |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). |
|
||||
| `response_format` | [Optional[operations.ResponseFormat]](../../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. Only "json" is supported. |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `file` | [operations.CreateAudioTranscriptionsMultipartFile](../../operations/createaudiotranscriptionsmultipartfile.mdx) | :heavy_check_mark: | The audio file to transcribe. The format is derived from the filename extension or the file part content type. Max 25 MB; send larger files as base64 JSON via input_audio. |
|
||||
| `model` | *str* | :heavy_check_mark: | The model to use for transcription. |
|
||||
| `http_referer` | *Optional[str]* | :heavy_minus_sign: | The app identifier should be your app's URL and is used as the primary identifier for rankings.<br/>This is used to track API usage per application.<br/> |
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> |
|
||||
| `language` | *Optional[str]* | :heavy_minus_sign: | The language of the input audio (ISO-639-1). |
|
||||
| `response_format` | [Optional[operations.ResponseFormat]](../../operations/responseformat.mdx) | :heavy_minus_sign: | The response format. "json" (default) returns \{ text, usage }; "verbose_json" additionally returns task, language, duration, and segment-level timestamps (OpenAI-compatible providers only). |
|
||||
| `temperature` | *Optional[float]* | :heavy_minus_sign: | The sampling temperature. |
|
||||
| `timestamp_granularities` | List[[operations.TimestampGranularities](../../operations/timestampgranularities.mdx)] | :heavy_minus_sign: | Timestamp detail levels to include when response_format is "verbose_json". "word" additionally returns word-level timestamps in the words array. |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. |
|
||||
|
||||
### Response
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ with OpenRouter(
|
||||
| `x_open_router_title` | *Optional[str]* | :heavy_minus_sign: | The app display name allows you to customize how your app appears in OpenRouter's dashboard.<br/> | |
|
||||
| `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.<br/> | |
|
||||
| `provider` | [Optional[components.SpeechRequestProvider]](../../components/speechrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `response_format` | [Optional[components.ResponseFormatEnum]](../../components/responseformatenum.mdx) | :heavy_minus_sign: | Audio output format | pcm |
|
||||
| `response_format` | [Optional[components.SpeechRequestResponseFormat]](../../components/speechrequestresponseformat.mdx) | :heavy_minus_sign: | Audio output format | pcm |
|
||||
| `speed` | *Optional[float]* | :heavy_minus_sign: | Playback speed multiplier. Only used by models that support it (e.g. OpenAI TTS). Ignored by other providers. | 1 |
|
||||
| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.mdx) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user