Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 171 additions & 52 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ generation:
documentation: mintlify
preApplyUnionDiscriminators: true
python:
version: 1.3.50
version: 1.3.51
additionalDependencies:
dev: {}
main: {}
Expand Down
252 changes: 252 additions & 0 deletions .speakeasy/out.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3525,6 +3525,232 @@ components:
- 'data'
- 'meta'
type: 'object'
ArmorAutoMode:
properties:
allow:
items:
anyOf:
- maxLength: 8122
minLength: 1
type: 'string'
- $ref: '#/components/schemas/ArmorRule'
type: 'array'
environment:
items:
anyOf:
- maxLength: 4122
minLength: 1
type: 'string'
- $ref: '#/components/schemas/ArmorEnvironmentEntry'
type: 'array'
hard_deny:
items:
anyOf:
- maxLength: 8122
minLength: 1
type: 'string'
- $ref: '#/components/schemas/ArmorRule'
type: 'array'
soft_deny:
items:
anyOf:
- maxLength: 8122
minLength: 1
type: 'string'
- $ref: '#/components/schemas/ArmorRule'
type: 'array'
type: 'object'
ArmorContext:
additionalProperties:
description: 'Carried unchanged; any JSON value.'
description: 'The Armor context: Claude Code''s `classifier_context` (v1), with `auto_mode.{hard_deny,soft_deny,allow}` rules as strings or `{ id, instructions, threshold? }` objects and `auto_mode.environment` entries as `"Name: value"` strings or `{ name, value }` objects. `threshold` applies when Armor evaluates; when the provider evaluates natively (Anthropic dangerous-tool-use beta) rules are judged at the provider''s own boundary.'
example:
auto_mode:
allow: []
environment:
- 'Trusted repo: github.com/acme/app'
hard_deny: []
soft_deny:
- id: 'secrets-in-vcs'
instructions: 'Staging, committing or pushing a file that holds secrets, including indirectly through git add -A when the tree shows one.'
v: 1
properties:
auto_mode:
$ref: '#/components/schemas/ArmorAutoMode'
v:
enum:
- 1
type: 'number'
required:
- 'v'
type: 'object'
ArmorEnvironmentEntry:
properties:
name:
maxLength: 120
minLength: 1
type: 'string'
value:
maxLength: 4000
type: 'string'
required:
- 'name'
- 'value'
type: 'object'
ArmorPlugin:
additionalProperties: false
description: 'Evaluates every client tool call the model emits against a rule stack (hard-deny, soft-deny, allow) before it reaches the caller. The stack merges the workspace guardrail, this plugin, and any Anthropic `safeguards`; on endpoints that support Anthropic''s `dangerous-tool-use` beta the evaluation is native, elsewhere it is one decisions call per tool call. Evaluation is not billed during the beta. Verdicts are reported as `safeguard_results`.'
example:
classifier_context:
auto_mode:
environment:
- 'Trusted repo: github.com/acme/app'
soft_deny:
- id: 'no-migrations-delete'
instructions: 'Deleting a file under db/migrations.'
v: 1
id: 'armor'
use_cc_style_default_rules: true
properties:
classifier_context:
$ref: '#/components/schemas/ArmorContext'
enabled:
description: 'Set to false to disable Armor for this request. Defaults to true.'
type: 'boolean'
evaluate_native_tools:
description: 'Run provider-native server tools (web search, code execution, ...) through the agent loop so Armor evaluates them too. Defaults to false: native passthrough stands and such calls are reported `skipped`.'
type: 'boolean'
id:
enum:
- 'armor'
type: 'string'
mode:
description: '`enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`.'
enum:
- 'enforce'
- 'audit'
type: 'string'
x-speakeasy-unknown-values: allow
on_error:
description: 'When the classifier cannot answer (timeout, upstream error, context too long) the call is reported `unavailable`; `block` rejects it and `log` releases it. Default `block`.'
enum:
- 'log'
- 'block'
type: 'string'
x-speakeasy-unknown-values: allow
output_mode:
description: 'How a blocked call reaches the caller. `text` (the default): the call is withheld and an `<openrouter_armor_blocked>` marker stands in assistant text. `custom_item` (Responses API only): the call is withheld and an `openrouter:armor_blocked` output item carries its id, name, arguments and the rule that fired. `claude_code_compatibility` (Messages API only; the default when the request carries a `dangerous_tool_use` safeguard, i.e. the client speaks Claude Code''s protocol): the `tool_use` stays in `content[]` and the verdict is `flagged` in `safeguard_results`, so the client withholds execution and writes the error tool result as under the native classifier. Under `text` and `custom_item` the model received a failure result in the loop and continued in the same request; under `claude_code_compatibility` the turn ends on the flagged call and the model continues on the next request, after the client''s denial.'
enum:
- 'text'
- 'custom_item'
- 'claude_code_compatibility'
type: 'string'
x-speakeasy-unknown-values: allow
use_cc_style_default_rules:
description: 'Prepend Claude Code''s built-in auto-mode rule set (1 hard-deny, 72 soft-deny, 17 allow, 21 environment slots) ahead of every configured rule. Defaults to true on the Anthropic Messages API and false elsewhere.'
type: 'boolean'
required:
- 'id'
type: 'object'
ArmorRule:
properties:
id:
description: 'Stable id, unique within its source; reported as the deciding rule when it fires.'
maxLength: 64
minLength: 1
pattern: '^[a-z0-9][a-z0-9_-]*$'
type: 'string'
instructions:
description: 'What the rule matches, written for the classifier.'
maxLength: 8000
minLength: 1
type: 'string'
name:
description: 'Display name shown in verdict explanations; defaults to the id.'
maxLength: 120
minLength: 1
type: 'string'
threshold:
description: 'Probability at or above which the rule counts as matched. Defaults to 0.6 for hard-deny and soft-deny rules and 0.7 for allow rules (an exception needs stronger evidence to clear a matched soft deny).'
format: 'double'
type: 'number'
required:
- 'id'
- 'instructions'
type: 'object'
ArmorSafeguardResult:
description: 'The outcome of OpenRouter Armor for each client tool call of the response, keyed by tool-call id, in the same shape Anthropic reports its server-side safeguards.'
example:
status:
tool_uses:
call_abc:
explanation: '[Data Exfiltration]'
outcome: 'flagged'
type: 'evaluated'
call_def:
outcome: 'not_flagged'
type: 'evaluated'
type: 'available'
type: 'dangerous_tool_use'
properties:
status:
properties:
tool_uses:
additionalProperties:
oneOf:
- properties:
explanation:
type: 'string'
outcome:
enum:
- 'flagged'
- 'not_flagged'
type: 'string'
x-speakeasy-unknown-values: allow
type:
enum:
- 'evaluated'
type: 'string'
required:
- 'type'
- 'outcome'
type: 'object'
- properties:
type:
enum:
- 'skipped'
type: 'string'
required:
- 'type'
type: 'object'
- properties:
reason:
type: 'string'
type:
enum:
- 'unavailable'
type: 'string'
required:
- 'type'
- 'reason'
type: 'object'
type: 'object'
type:
enum:
- 'available'
type: 'string'
required:
- 'type'
- 'tool_uses'
type: 'object'
type:
enum:
- 'dangerous_tool_use'
type: 'string'
required:
- 'type'
- 'status'
type: 'object'
AutoBetaRouterPlugin:
example:
allowed_models:
Expand Down Expand Up @@ -5536,6 +5762,11 @@ components:
type:
- 'string'
- 'null'
safeguard_results:
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
items:
$ref: '#/components/schemas/ArmorSafeguardResult'
type: 'array'
service_tier:
type:
- 'string'
Expand Down Expand Up @@ -7508,6 +7739,7 @@ components:
discriminator:
mapping:
alignment: '#/components/schemas/AlignmentPlugin'
armor: '#/components/schemas/ArmorPlugin'
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
auto-router: '#/components/schemas/AutoRouterPlugin'
context-compression: '#/components/schemas/ContextCompressionPlugin'
Expand Down Expand Up @@ -7535,6 +7767,7 @@ components:
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
- $ref: '#/components/schemas/JevRouterPlugin'
- $ref: '#/components/schemas/AlignmentPlugin'
- $ref: '#/components/schemas/ArmorPlugin'
type: 'array'
prediction:
$ref: '#/components/schemas/Prediction'
Expand Down Expand Up @@ -7765,6 +7998,11 @@ components:
type: 'string'
openrouter_metadata:
$ref: '#/components/schemas/OpenRouterMetadata'
safeguard_results:
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
items:
$ref: '#/components/schemas/ArmorSafeguardResult'
type: 'array'
service_tier:
description: 'The service tier used by the upstream provider for this request'
example: 'default'
Expand Down Expand Up @@ -7912,6 +8150,11 @@ components:
type: 'string'
openrouter_metadata:
$ref: '#/components/schemas/OpenRouterMetadata'
safeguard_results:
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
items:
$ref: '#/components/schemas/ArmorSafeguardResult'
type: 'array'
service_tier:
description: 'The service tier used by the upstream provider for this request'
example: 'default'
Expand Down Expand Up @@ -17651,6 +17894,7 @@ components:
discriminator:
mapping:
alignment: '#/components/schemas/AlignmentPlugin'
armor: '#/components/schemas/ArmorPlugin'
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
auto-router: '#/components/schemas/AutoRouterPlugin'
context-compression: '#/components/schemas/ContextCompressionPlugin'
Expand Down Expand Up @@ -17678,6 +17922,7 @@ components:
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
- $ref: '#/components/schemas/JevRouterPlugin'
- $ref: '#/components/schemas/AlignmentPlugin'
- $ref: '#/components/schemas/ArmorPlugin'
type: 'array'
provider:
$ref: '#/components/schemas/ProviderPreferences'
Expand Down Expand Up @@ -22770,6 +23015,11 @@ components:
items:
$ref: '#/components/schemas/OutputItems'
type: 'array'
safeguard_results:
description: 'OpenRouter Armor''s verdict for each client tool call of this response, present whenever Armor evaluated the response (even when nothing was flagged). Independent of the `openrouter_metadata` opt-in.'
items:
$ref: '#/components/schemas/ArmorSafeguardResult'
type: 'array'
service_tier:
type:
- 'string'
Expand Down Expand Up @@ -28350,6 +28600,7 @@ components:
discriminator:
mapping:
alignment: '#/components/schemas/AlignmentPlugin'
armor: '#/components/schemas/ArmorPlugin'
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
auto-router: '#/components/schemas/AutoRouterPlugin'
context-compression: '#/components/schemas/ContextCompressionPlugin'
Expand Down Expand Up @@ -28377,6 +28628,7 @@ components:
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
- $ref: '#/components/schemas/JevRouterPlugin'
- $ref: '#/components/schemas/AlignmentPlugin'
- $ref: '#/components/schemas/ArmorPlugin'
type: 'array'
presence_penalty:
format: 'double'
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.787.0
sources:
OpenRouter API:
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:16296a47c2aaceda7bf9b800026bfc9bfc0f9dc7208592c357778c586c4e6685
sourceBlobDigest: sha256:5053e13680878fb5e3220166cd240b24d57d6b62118d0ce7e96133b86210517c
sourceRevisionDigest: sha256:e2169a770b941899e588257c4a70ea18f0b4c48a6de2f1032609d7b5b8bf6267
sourceBlobDigest: sha256:199b89e56ea9f453448a916e5c38422d9d4196dfb5955aab34bbc0a55d01507b
tags:
- latest
- 1.0.0
targets:
open-router:
source: OpenRouter API
sourceNamespace: open-router-chat-completions-api
sourceRevisionDigest: sha256:16296a47c2aaceda7bf9b800026bfc9bfc0f9dc7208592c357778c586c4e6685
sourceBlobDigest: sha256:5053e13680878fb5e3220166cd240b24d57d6b62118d0ce7e96133b86210517c
sourceRevisionDigest: sha256:e2169a770b941899e588257c4a70ea18f0b4c48a6de2f1032609d7b5b8bf6267
sourceBlobDigest: sha256:199b89e56ea9f453448a916e5c38422d9d4196dfb5955aab34bbc0a55d01507b
codeSamplesNamespace: open-router-python-code-samples
codeSamplesRevisionDigest: sha256:ec820930c43abfd607c9dcea3f9a481a9046009afcab47fa46e1a173282cf28c
codeSamplesRevisionDigest: sha256:0040c3bdfdf4a39c108fe13d2fc1a9ed73c4f2e41595d7602577c75ed22728f9
workflow:
workflowVersion: 1.0.0
speakeasyVersion: 1.787.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3269,4 +3269,14 @@ Based on:
### Generated
- [python v1.3.50] .
### Releases
- [PyPI v1.3.50] https://pypi.org/project/openrouter/1.3.50 - .
- [PyPI v1.3.50] https://pypi.org/project/openrouter/1.3.50 - .

## 2026-10-14 14:13:02
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v1.3.51] .
### Releases
- [PyPI v1.3.51] https://pypi.org/project/openrouter/1.3.51 - .
18 changes: 18 additions & 0 deletions docs/components/allow.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Allow"
---

## Supported Types

### `str`

```python
value: str = /* values here */
```

### `components.ArmorRule`

```python
value: components.ArmorRule = /* values here */
```

Loading