From 9312cabf22d6eecc66e77c082a7d19ecda308ccc Mon Sep 17 00:00:00 2001 From: robert-j-y <212159665+robert-j-y@users.noreply.github.com> Date: Wed, 13 May 2026 18:10:03 -0700 Subject: [PATCH] chore: update OpenAPI spec from monorepo (#245) Co-authored-by: OpenRouter SDK Bot --- .speakeasy/in.openapi.yaml | 159 ++++++++++++++++++++++++++++++++++--- 1 file changed, 147 insertions(+), 12 deletions(-) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 1a309c7..e602279 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -17107,13 +17107,55 @@ paths: '403': content: application/json: - example: - error: - code: 403 - message: Only management keys can perform this operation + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation schema: $ref: '#/components/schemas/ForbiddenResponse' - description: Forbidden - Authentication successful but insufficient permissions + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When + guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response + includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage + details. '404': content: application/json: @@ -20778,14 +20820,55 @@ paths: '403': content: application/json: - example: - error: - message: Permission denied - type: permission_error - type: error + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation schema: - $ref: '#/components/schemas/MessagesErrorResponse' - description: Permission denied error + $ref: '#/components/schemas/ForbiddenResponse' + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When + guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response + includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage + details. '404': content: application/json: @@ -22311,6 +22394,58 @@ paths: schema: $ref: '#/components/schemas/PaymentRequiredResponse' description: Payment Required - Insufficient credits or quota to complete request + '403': + content: + application/json: + examples: + guardrail-blocked: + summary: Guardrail blocked the request + value: + error: + code: 403 + message: 'Request blocked: prompt injection patterns detected' + metadata: + patterns: + - ignore all previous instructions + openrouter_metadata: + attempt: 1 + endpoints: + available: + - model: openai/gpt-4o + provider: OpenAI + selected: false + total: 1 + is_byok: false + pipeline: + - data: + action: blocked + detected: true + engines: + - regex + patterns: + - ignore all previous instructions + guardrail_id: grd_abc123 + guardrail_scope: api-key + name: regex_pi_detection + summary: 'Blocked: prompt injection detected (1 pattern matched)' + type: guardrail + region: iad + requested: openai/gpt-4o + strategy: direct + summary: available=1 + insufficient-permissions: + summary: Insufficient permissions + value: + error: + code: 403 + message: Only management keys can perform this operation + schema: + $ref: '#/components/schemas/ForbiddenResponse' + description: >- + Forbidden - Authentication successful but insufficient permissions, or a guardrail blocked the request. When + guardrails block and the `X-OpenRouter-Experimental-Metadata: enabled` header is present, the response + includes `openrouter_metadata` with full routing context and a `pipeline` array containing guardrail stage + details. '404': content: application/json: