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.25 (#438)
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
68b867f65c
commit
4d598caab2
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "ImageGenerationProviderPreferences"
|
||||
---
|
||||
|
||||
Provider routing preferences and provider-specific passthrough configuration.
|
||||
|
||||
|
||||
## 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/> | |
|
||||
| `ignore` | List[[components.ImageGenerationProviderPreferencesIgnore](../components/imagegenerationproviderpreferencesignore.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `only` | List[[components.ImageGenerationProviderPreferencesOnly](../components/imagegenerationproviderpreferencesonly.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `options` | [Optional[components.ImageGenerationProviderPreferencesOptions]](../components/imagegenerationproviderpreferencesoptions.mdx) | :heavy_minus_sign: | N/A | \{<br/>"black-forest-labs": \{<br/>"guidance": 3,<br/>"steps": 40<br/>}<br/>} |
|
||||
| `order` | List[[components.ImageGenerationProviderPreferencesOrder](../components/imagegenerationproviderpreferencesorder.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `sort` | [OptionalNullable[components.ImageGenerationProviderPreferencesSort]](../components/imagegenerationproviderpreferencessort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "ImageGenerationProviderPreferencesIgnore"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "ImageGenerationProviderPreferencesOnly"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "ImageGenerationRequestOptions"
|
||||
title: "ImageGenerationProviderPreferencesOptions"
|
||||
---
|
||||
|
||||
Provider-specific options keyed by provider slug. Only options for the matched provider are forwarded; the rest are ignored. Unrecognized keys are silently dropped.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "ImageGenerationProviderPreferencesOrder"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderName`
|
||||
|
||||
```python
|
||||
value: components.ProviderName = /* values here */
|
||||
```
|
||||
|
||||
### `str`
|
||||
|
||||
```python
|
||||
value: str = /* values here */
|
||||
```
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "ImageGenerationProviderPreferencesSort"
|
||||
---
|
||||
|
||||
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
||||
|
||||
|
||||
## Supported Types
|
||||
|
||||
### `components.ProviderSort`
|
||||
|
||||
```python
|
||||
value: components.ProviderSort = /* values here */
|
||||
```
|
||||
|
||||
### `components.ProviderSortConfig`
|
||||
|
||||
```python
|
||||
value: components.ProviderSortConfig = /* values here */
|
||||
```
|
||||
|
||||
### `Any`
|
||||
|
||||
```python
|
||||
value: Any = /* values here */
|
||||
```
|
||||
|
||||
@@ -17,7 +17,7 @@ Image generation request input
|
||||
| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 |
|
||||
| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png |
|
||||
| `prompt` | *str* | :heavy_check_mark: | Text description of the desired image | a red panda astronaut floating in space, studio lighting |
|
||||
| `provider` | [Optional[components.ImageGenerationRequestProvider]](../components/imagegenerationrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../components/imagegenerationproviderpreferences.mdx) | :heavy_minus_sign: | Provider routing preferences and provider-specific passthrough configuration. | \{<br/>"allow_fallbacks": false,<br/>"only": [<br/>"google-ai-studio"<br/>]<br/>} |
|
||||
| `quality` | [Optional[components.ImageGenerationRequestQuality]](../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high |
|
||||
| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K |
|
||||
| `seed` | *Optional[int]* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | |
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
title: "ImageGenerationRequestProvider"
|
||||
---
|
||||
|
||||
Provider-specific passthrough configuration
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `options` | [Optional[components.ImageGenerationRequestOptions]](../components/imagegenerationrequestoptions.mdx) | :heavy_minus_sign: | N/A | \{<br/>"black-forest-labs": \{<br/>"guidance": 3,<br/>"steps": 40<br/>}<br/>} |
|
||||
@@ -12,13 +12,13 @@ When multiple model providers are available, optionally indicate your routing pr
|
||||
| `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/> | |
|
||||
| `data_collection` | [OptionalNullable[components.DataCollection]](../components/datacollection.mdx) | :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/><br/>- deny: use only providers which do not collect user data. | allow |
|
||||
| `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 |
|
||||
| `ignore` | List[[components.Ignore](../components/ignore.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `ignore` | List[[components.ProviderPreferencesIgnore](../components/providerpreferencesignore.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `max_price` | [Optional[components.MaxPrice]](../components/maxprice.mdx) | :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. | |
|
||||
| `only` | List[[components.Only](../components/only.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `order` | List[[components.Order](../components/order.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `only` | List[[components.ProviderPreferencesOnly](../components/providerpreferencesonly.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `order` | List[[components.ProviderPreferencesOrder](../components/providerpreferencesorder.mdx)] | :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. | [<br/>"openai",<br/>"anthropic"<br/>] |
|
||||
| `preferred_max_latency` | [OptionalNullable[components.PreferredMaxLatency]](../components/preferredmaxlatency.mdx) | :heavy_minus_sign: | Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 5 |
|
||||
| `preferred_min_throughput` | [OptionalNullable[components.PreferredMinThroughput]](../components/preferredminthroughput.mdx) | :heavy_minus_sign: | Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold. | 100 |
|
||||
| `quantizations` | List[[components.Quantization](../components/quantization.mdx)] | :heavy_minus_sign: | A list of quantization levels to filter the provider by. | |
|
||||
| `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. | |
|
||||
| `sort` | [OptionalNullable[components.Sort]](../components/sort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
|
||||
| `sort` | [OptionalNullable[components.ProviderPreferencesSort]](../components/providerpreferencessort.mdx) | :heavy_minus_sign: | The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed. | price |
|
||||
| `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 |
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Only"
|
||||
title: "ProviderPreferencesIgnore"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Ignore"
|
||||
title: "ProviderPreferencesOnly"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Order"
|
||||
title: "ProviderPreferencesOrder"
|
||||
---
|
||||
|
||||
## Supported Types
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Sort"
|
||||
title: "ProviderPreferencesSort"
|
||||
---
|
||||
|
||||
The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
|
||||
@@ -55,7 +55,7 @@ with OpenRouter(
|
||||
| `n` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate (1-10). Providers that only support single-image generation reject n > 1. | 1 |
|
||||
| `output_compression` | *Optional[int]* | :heavy_minus_sign: | Compression level (0-100) for webp/jpeg output. Ignored for png and by providers without a compression knob. | 100 |
|
||||
| `output_format` | [Optional[components.ImageGenerationRequestOutputFormat]](../../components/imagegenerationrequestoutputformat.mdx) | :heavy_minus_sign: | Encoding of the returned image bytes. Most models produce raster formats (png, jpeg, webp). SVG is supported by vectorization models (e.g. Quiver) — the SVG markup is UTF-8 base64-encoded in `b64_json`. | png |
|
||||
| `provider` | [Optional[components.ImageGenerationRequestProvider]](../../components/imagegenerationrequestprovider.mdx) | :heavy_minus_sign: | Provider-specific passthrough configuration | |
|
||||
| `provider` | [Optional[components.ImageGenerationProviderPreferences]](../../components/imagegenerationproviderpreferences.mdx) | :heavy_minus_sign: | Provider routing preferences and provider-specific passthrough configuration. | \{<br/>"allow_fallbacks": false,<br/>"only": [<br/>"google-ai-studio"<br/>]<br/>} |
|
||||
| `quality` | [Optional[components.ImageGenerationRequestQuality]](../../components/imagegenerationrequestquality.mdx) | :heavy_minus_sign: | Rendering quality. Providers without a quality knob ignore this. | high |
|
||||
| `resolution` | [Optional[components.ImageGenerationRequestResolution]](../../components/imagegenerationrequestresolution.mdx) | :heavy_minus_sign: | Normalized resolution tier of the generated image. Concrete pixel dimensions are derived per-provider. | 2K |
|
||||
| `seed` | *Optional[int]* | :heavy_minus_sign: | If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers. | |
|
||||
|
||||
Reference in New Issue
Block a user