Skip to content

Commit 671d501

Browse files
openrouter-docs-sync[bot]OpenRouter SDK Bot
andauthored
chore: update OpenAPI spec from monorepo (#1071)
Co-authored-by: OpenRouter SDK Bot <sdk-bot@openrouter.ai>
1 parent 74a3641 commit 671d501

1 file changed

Lines changed: 248 additions & 0 deletions

File tree

‎.speakeasy/in.openapi.yaml‎

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3471,6 +3471,228 @@ components:
34713471
- 'data'
34723472
- 'meta'
34733473
type: 'object'
3474+
ArmorAutoMode:
3475+
properties:
3476+
allow:
3477+
items:
3478+
anyOf:
3479+
- maxLength: 8122
3480+
minLength: 1
3481+
type: 'string'
3482+
- $ref: '#/components/schemas/ArmorRule'
3483+
type: 'array'
3484+
environment:
3485+
items:
3486+
anyOf:
3487+
- maxLength: 4122
3488+
minLength: 1
3489+
type: 'string'
3490+
- $ref: '#/components/schemas/ArmorEnvironmentEntry'
3491+
type: 'array'
3492+
hard_deny:
3493+
items:
3494+
anyOf:
3495+
- maxLength: 8122
3496+
minLength: 1
3497+
type: 'string'
3498+
- $ref: '#/components/schemas/ArmorRule'
3499+
type: 'array'
3500+
soft_deny:
3501+
items:
3502+
anyOf:
3503+
- maxLength: 8122
3504+
minLength: 1
3505+
type: 'string'
3506+
- $ref: '#/components/schemas/ArmorRule'
3507+
type: 'array'
3508+
type: 'object'
3509+
ArmorContext:
3510+
additionalProperties:
3511+
description: 'Carried unchanged; any JSON value.'
3512+
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.'
3513+
example:
3514+
auto_mode:
3515+
allow: []
3516+
environment:
3517+
- 'Trusted repo: github.com/acme/app'
3518+
hard_deny: []
3519+
soft_deny:
3520+
- id: 'secrets-in-vcs'
3521+
instructions: 'Staging, committing or pushing a file that holds secrets, including indirectly through git add -A when the tree shows one.'
3522+
v: 1
3523+
properties:
3524+
auto_mode:
3525+
$ref: '#/components/schemas/ArmorAutoMode'
3526+
v:
3527+
enum:
3528+
- 1
3529+
type: 'number'
3530+
required:
3531+
- 'v'
3532+
type: 'object'
3533+
ArmorEnvironmentEntry:
3534+
properties:
3535+
name:
3536+
maxLength: 120
3537+
minLength: 1
3538+
type: 'string'
3539+
value:
3540+
maxLength: 4000
3541+
type: 'string'
3542+
required:
3543+
- 'name'
3544+
- 'value'
3545+
type: 'object'
3546+
ArmorPlugin:
3547+
additionalProperties: false
3548+
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`.'
3549+
example:
3550+
classifier_context:
3551+
auto_mode:
3552+
environment:
3553+
- 'Trusted repo: github.com/acme/app'
3554+
soft_deny:
3555+
- id: 'no-migrations-delete'
3556+
instructions: 'Deleting a file under db/migrations.'
3557+
v: 1
3558+
id: 'armor'
3559+
use_cc_style_default_rules: true
3560+
properties:
3561+
classifier_context:
3562+
$ref: '#/components/schemas/ArmorContext'
3563+
enabled:
3564+
description: 'Set to false to disable Armor for this request. Defaults to true.'
3565+
type: 'boolean'
3566+
evaluate_native_tools:
3567+
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`.'
3568+
type: 'boolean'
3569+
id:
3570+
enum:
3571+
- 'armor'
3572+
type: 'string'
3573+
mode:
3574+
description: '`enforce` withholds blocked calls; `audit` evaluates and reports the same verdicts without withholding any calls, regardless of `on_error`. Default `enforce`.'
3575+
enum:
3576+
- 'enforce'
3577+
- 'audit'
3578+
type: 'string'
3579+
on_error:
3580+
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`.'
3581+
enum:
3582+
- 'log'
3583+
- 'block'
3584+
type: 'string'
3585+
output_mode:
3586+
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.'
3587+
enum:
3588+
- 'text'
3589+
- 'custom_item'
3590+
- 'claude_code_compatibility'
3591+
type: 'string'
3592+
use_cc_style_default_rules:
3593+
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.'
3594+
type: 'boolean'
3595+
required:
3596+
- 'id'
3597+
type: 'object'
3598+
ArmorRule:
3599+
properties:
3600+
id:
3601+
description: 'Stable id, unique within its source; reported as the deciding rule when it fires.'
3602+
maxLength: 64
3603+
minLength: 1
3604+
pattern: '^[a-z0-9][a-z0-9_-]*$'
3605+
type: 'string'
3606+
instructions:
3607+
description: 'What the rule matches, written for the classifier.'
3608+
maxLength: 8000
3609+
minLength: 1
3610+
type: 'string'
3611+
name:
3612+
description: 'Display name shown in verdict explanations; defaults to the id.'
3613+
maxLength: 120
3614+
minLength: 1
3615+
type: 'string'
3616+
threshold:
3617+
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).'
3618+
format: 'double'
3619+
type: 'number'
3620+
required:
3621+
- 'id'
3622+
- 'instructions'
3623+
type: 'object'
3624+
ArmorSafeguardResult:
3625+
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.'
3626+
example:
3627+
status:
3628+
tool_uses:
3629+
call_abc:
3630+
explanation: '[Data Exfiltration]'
3631+
outcome: 'flagged'
3632+
type: 'evaluated'
3633+
call_def:
3634+
outcome: 'not_flagged'
3635+
type: 'evaluated'
3636+
type: 'available'
3637+
type: 'dangerous_tool_use'
3638+
properties:
3639+
status:
3640+
properties:
3641+
tool_uses:
3642+
additionalProperties:
3643+
oneOf:
3644+
- properties:
3645+
explanation:
3646+
type: 'string'
3647+
outcome:
3648+
enum:
3649+
- 'flagged'
3650+
- 'not_flagged'
3651+
type: 'string'
3652+
type:
3653+
enum:
3654+
- 'evaluated'
3655+
type: 'string'
3656+
required:
3657+
- 'type'
3658+
- 'outcome'
3659+
type: 'object'
3660+
- properties:
3661+
type:
3662+
enum:
3663+
- 'skipped'
3664+
type: 'string'
3665+
required:
3666+
- 'type'
3667+
type: 'object'
3668+
- properties:
3669+
reason:
3670+
type: 'string'
3671+
type:
3672+
enum:
3673+
- 'unavailable'
3674+
type: 'string'
3675+
required:
3676+
- 'type'
3677+
- 'reason'
3678+
type: 'object'
3679+
type: 'object'
3680+
type:
3681+
enum:
3682+
- 'available'
3683+
type: 'string'
3684+
required:
3685+
- 'type'
3686+
- 'tool_uses'
3687+
type: 'object'
3688+
type:
3689+
enum:
3690+
- 'dangerous_tool_use'
3691+
type: 'string'
3692+
required:
3693+
- 'type'
3694+
- 'status'
3695+
type: 'object'
34743696
AutoBetaRouterPlugin:
34753697
example:
34763698
allowed_models:
@@ -5473,6 +5695,11 @@ components:
54735695
type:
54745696
- 'string'
54755697
- 'null'
5698+
safeguard_results:
5699+
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.'
5700+
items:
5701+
$ref: '#/components/schemas/ArmorSafeguardResult'
5702+
type: 'array'
54765703
service_tier:
54775704
type:
54785705
- 'string'
@@ -7433,6 +7660,7 @@ components:
74337660
discriminator:
74347661
mapping:
74357662
alignment: '#/components/schemas/AlignmentPlugin'
7663+
armor: '#/components/schemas/ArmorPlugin'
74367664
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
74377665
auto-router: '#/components/schemas/AutoRouterPlugin'
74387666
context-compression: '#/components/schemas/ContextCompressionPlugin'
@@ -7460,6 +7688,7 @@ components:
74607688
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
74617689
- $ref: '#/components/schemas/JevRouterPlugin'
74627690
- $ref: '#/components/schemas/AlignmentPlugin'
7691+
- $ref: '#/components/schemas/ArmorPlugin'
74637692
type: 'array'
74647693
prediction:
74657694
$ref: '#/components/schemas/Prediction'
@@ -7687,6 +7916,11 @@ components:
76877916
type: 'string'
76887917
openrouter_metadata:
76897918
$ref: '#/components/schemas/OpenRouterMetadata'
7919+
safeguard_results:
7920+
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.'
7921+
items:
7922+
$ref: '#/components/schemas/ArmorSafeguardResult'
7923+
type: 'array'
76907924
service_tier:
76917925
description: 'The service tier used by the upstream provider for this request'
76927926
example: 'default'
@@ -7834,6 +8068,11 @@ components:
78348068
type: 'string'
78358069
openrouter_metadata:
78368070
$ref: '#/components/schemas/OpenRouterMetadata'
8071+
safeguard_results:
8072+
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.'
8073+
items:
8074+
$ref: '#/components/schemas/ArmorSafeguardResult'
8075+
type: 'array'
78378076
service_tier:
78388077
description: 'The service tier used by the upstream provider for this request'
78398078
example: 'default'
@@ -17509,6 +17748,7 @@ components:
1750917748
discriminator:
1751017749
mapping:
1751117750
alignment: '#/components/schemas/AlignmentPlugin'
17751+
armor: '#/components/schemas/ArmorPlugin'
1751217752
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
1751317753
auto-router: '#/components/schemas/AutoRouterPlugin'
1751417754
context-compression: '#/components/schemas/ContextCompressionPlugin'
@@ -17536,6 +17776,7 @@ components:
1753617776
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
1753717777
- $ref: '#/components/schemas/JevRouterPlugin'
1753817778
- $ref: '#/components/schemas/AlignmentPlugin'
17779+
- $ref: '#/components/schemas/ArmorPlugin'
1753917780
type: 'array'
1754017781
provider:
1754117782
$ref: '#/components/schemas/ProviderPreferences'
@@ -22613,6 +22854,11 @@ components:
2261322854
items:
2261422855
$ref: '#/components/schemas/OutputItems'
2261522856
type: 'array'
22857+
safeguard_results:
22858+
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.'
22859+
items:
22860+
$ref: '#/components/schemas/ArmorSafeguardResult'
22861+
type: 'array'
2261622862
service_tier:
2261722863
type:
2261822864
- 'string'
@@ -28159,6 +28405,7 @@ components:
2815928405
discriminator:
2816028406
mapping:
2816128407
alignment: '#/components/schemas/AlignmentPlugin'
28408+
armor: '#/components/schemas/ArmorPlugin'
2816228409
auto-beta-router: '#/components/schemas/AutoBetaRouterPlugin'
2816328410
auto-router: '#/components/schemas/AutoRouterPlugin'
2816428411
context-compression: '#/components/schemas/ContextCompressionPlugin'
@@ -28186,6 +28433,7 @@ components:
2818628433
- $ref: '#/components/schemas/SwitchyardRouterPlugin'
2818728434
- $ref: '#/components/schemas/JevRouterPlugin'
2818828435
- $ref: '#/components/schemas/AlignmentPlugin'
28436+
- $ref: '#/components/schemas/ArmorPlugin'
2818928437
type: 'array'
2819028438
presence_penalty:
2819128439
format: 'double'

0 commit comments

Comments
 (0)