Skip to content

Commit ee4e790

Browse files
committed
## Python SDK Changes:
* `open_router.chat.send()`: * `request` **Changed** * `response.choices[].message.content.union(Array<ChatContentItems>)[].union(text).prompt_cache_breakpoint` **Added** * `open_router.presets.create_presets_chat_completions()`: `request` **Changed**
1 parent f07b760 commit ee4e790

55 files changed

Lines changed: 473 additions & 334 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.speakeasy/gen.lock

Lines changed: 105 additions & 105 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ generation:
3636
documentation: mintlify
3737
preApplyUnionDiscriminators: true
3838
python:
39-
version: 0.11.31
39+
version: 0.11.32
4040
additionalDependencies:
4141
dev: {}
4242
main: {}

.speakeasy/out.openapi.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ components:
671671
type: object
672672
AnthropicCacheControlDirective:
673673
description: >-
674-
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
674+
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
675675
example:
676676
type: ephemeral
677677
properties:
@@ -4458,7 +4458,8 @@ components:
44584458
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
44594459
- properties: {}
44604460
type: object
4461-
description: Cache control for the content part
4461+
description: >-
4462+
Anthropic-style cache breakpoint for the content part. Interchangeable with the OpenAI-style `prompt_cache_breakpoint` marker: OpenRouter converts between the two based on the provider serving the request.
44624463
example:
44634464
ttl: 5m
44644465
type: ephemeral
@@ -4553,6 +4554,8 @@ components:
45534554
properties:
45544555
cache_control:
45554556
$ref: '#/components/schemas/ChatContentCacheControl'
4557+
prompt_cache_breakpoint:
4558+
$ref: '#/components/schemas/PromptCacheBreakpoint'
45564559
text:
45574560
type: string
45584561
type:
@@ -5047,6 +5050,11 @@ components:
50475050
format: double
50485051
nullable: true
50495052
type: number
5053+
prompt_cache_key:
5054+
nullable: true
5055+
type: string
5056+
prompt_cache_options:
5057+
$ref: '#/components/schemas/PromptCacheOptions'
50505058
provider:
50515059
$ref: '#/components/schemas/ProviderPreferences'
50525060
reasoning:
@@ -18337,7 +18345,7 @@ components:
1833718345
type: object
1833818346
PromptCacheBreakpoint:
1833918347
description: >-
18340-
Marks an explicit prompt-cache boundary on this content block. Everything through the block carrying this marker is part of the candidate cached prefix. Only supported by OpenAI GPT-5.6 and newer.
18348+
Marks an explicit prompt-cache boundary on this content block (OpenAI-style). Everything through the block carrying this marker is part of the candidate cached prefix. Supported natively by OpenAI GPT-5.6 and newer; on providers that use Anthropic-style `cache_control`, OpenRouter converts the marker to that format automatically.
1834118349
example:
1834218350
mode: explicit
1834318351
nullable: true

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ speakeasyVersion: 1.787.0
22
sources:
33
OpenRouter API:
44
sourceNamespace: open-router-chat-completions-api
5-
sourceRevisionDigest: sha256:e41d9374b62c6364b29b039f24a6fa33b6e1aecd74f3d592b4e5dc0e8915f539
6-
sourceBlobDigest: sha256:3395078b604c8be9e707ef5d4bfc1861adb8b27ec5b3e960694744eb75dce17c
5+
sourceRevisionDigest: sha256:7ba0690911aa50c921dd9903da84f01fc6f17c079b207e23cdf58ea361564199
6+
sourceBlobDigest: sha256:d60cb272a488a05daf5bfe8efc1b69083f75852bff82d8deea1714b429b4d4fc
77
tags:
88
- latest
99
- 1.0.0
1010
targets:
1111
open-router:
1212
source: OpenRouter API
1313
sourceNamespace: open-router-chat-completions-api
14-
sourceRevisionDigest: sha256:e41d9374b62c6364b29b039f24a6fa33b6e1aecd74f3d592b4e5dc0e8915f539
15-
sourceBlobDigest: sha256:3395078b604c8be9e707ef5d4bfc1861adb8b27ec5b3e960694744eb75dce17c
14+
sourceRevisionDigest: sha256:7ba0690911aa50c921dd9903da84f01fc6f17c079b207e23cdf58ea361564199
15+
sourceBlobDigest: sha256:d60cb272a488a05daf5bfe8efc1b69083f75852bff82d8deea1714b429b4d4fc
1616
codeSamplesNamespace: open-router-python-code-samples
17-
codeSamplesRevisionDigest: sha256:4cb898e1201b335e38601e54fb5999ae9b324e5a45e518a0b443bd823affee26
17+
codeSamplesRevisionDigest: sha256:f52550d8391f3b538a0b03a1f483c981fcb926e95bec37ffa581344cfaf0d1e8
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: 1.787.0

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,14 @@ Based on:
418418
### Generated
419419
- [python v0.11.31] .
420420
### Releases
421-
- [PyPI v0.11.31] https://pypi.org/project/openrouter/0.11.31 - .
421+
- [PyPI v0.11.31] https://pypi.org/project/openrouter/0.11.31 - .
422+
423+
## 2026-07-14 21:26:36
424+
### Changes
425+
Based on:
426+
- OpenAPI Doc
427+
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
428+
### Generated
429+
- [python v0.11.32] .
430+
### Releases
431+
- [PyPI v0.11.32] https://pypi.org/project/openrouter/0.11.32 - .

docs/components/anthropiccachecontroldirective.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "AnthropicCacheControlDirective"
33
---
44

5-
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models.
5+
Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format.
66

77

88
## Fields

docs/components/anthropicdocumentblockparam.mdx

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

docs/components/anthropicimageblockparam.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "AnthropicImageBlockParam"
44

55
## Fields
66

7-
| Field | Type | Required | Description | Example |
8-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9-
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. | \{<br/>"type": "ephemeral"<br/>} |
10-
| `source` | [components.AnthropicImageBlockParamSource](../components/anthropicimageblockparamsource.mdx) | :heavy_check_mark: | N/A | |
11-
| `type` | [components.AnthropicImageBlockParamType](../components/anthropicimageblockparamtype.mdx) | :heavy_check_mark: | N/A | |
7+
| Field | Type | Required | Description | Example |
8+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9+
| `cache_control` | [Optional[components.AnthropicCacheControlDirective]](../components/anthropiccachecontroldirective.mdx) | :heavy_minus_sign: | Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. When set on an individual content block, it marks an explicit cache breakpoint; block-level markers also work on OpenAI models that support explicit prompt caching — OpenRouter converts them to the provider's native format. | \{<br/>"type": "ephemeral"<br/>} |
10+
| `source` | [components.AnthropicImageBlockParamSource](../components/anthropicimageblockparamsource.mdx) | :heavy_check_mark: | N/A | |
11+
| `type` | [components.AnthropicImageBlockParamType](../components/anthropicimageblockparamtype.mdx) | :heavy_check_mark: | N/A | |

0 commit comments

Comments
 (0)