diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml
index 7a4f61ff..4e722c7a 100644
--- a/.speakeasy/in.openapi.yaml
+++ b/.speakeasy/in.openapi.yaml
@@ -1,2947 +1,2450 @@
-openapi: 3.1.0
-info:
- title: OpenRouter API
- version: 1.0.0
- description: OpenAI-compatible API with additional OpenRouter features
- contact:
- name: OpenRouter Support
- url: https://openrouter.ai/docs
- email: support@openrouter.ai
- license:
- name: MIT
- url: https://opensource.org/licenses/MIT
-servers:
- - url: https://openrouter.ai/api/v1
- description: Production server
- x-speakeasy-server-id: production
-security:
- - apiKey: []
-externalDocs:
- description: OpenRouter Documentation
- url: https://openrouter.ai/docs
components:
+ parameters: {}
schemas:
- OpenAIResponsesResponseStatus:
- type: string
- enum:
- - completed
- - incomplete
- - in_progress
- - failed
- - cancelled
- - queued
- example: completed
- FileCitation:
- type: object
+ ActivityItem:
+ example:
+ byok_usage_inference: 0.012
+ completion_tokens: 125
+ date: '2025-08-24'
+ endpoint_id: 550e8400-e29b-41d4-a716-446655440000
+ model: openai/gpt-4.1
+ model_permaslug: openai/gpt-4.1-2025-04-14
+ prompt_tokens: 50
+ provider_name: OpenAI
+ reasoning_tokens: 25
+ requests: 5
+ usage: 0.015
properties:
- type:
+ byok_usage_inference:
+ description: BYOK inference cost in USD (external credits spent)
+ example: 0.012
+ format: double
+ type: number
+ completion_tokens:
+ description: Total completion tokens generated
+ example: 125
+ type: integer
+ date:
+ description: Date of the activity (YYYY-MM-DD format)
+ example: '2025-08-24'
type: string
- enum:
- - file_citation
- file_id:
+ endpoint_id:
+ description: Unique identifier for the endpoint
+ example: 550e8400-e29b-41d4-a716-446655440000
type: string
- filename:
+ model:
+ description: Model slug (e.g., "openai/gpt-4.1")
+ example: openai/gpt-4.1
type: string
- index:
+ model_permaslug:
+ description: Model permaslug (e.g., "openai/gpt-4.1-2025-04-14")
+ example: openai/gpt-4.1-2025-04-14
+ type: string
+ prompt_tokens:
+ description: Total prompt tokens used
+ example: 50
+ type: integer
+ provider_name:
+ description: Name of the provider serving this endpoint
+ example: OpenAI
+ type: string
+ reasoning_tokens:
+ description: Total reasoning tokens used
+ example: 25
+ type: integer
+ requests:
+ description: Number of requests made
+ example: 5
type: integer
+ usage:
+ description: Total cost in USD (OpenRouter credits spent)
+ example: 0.015
+ format: double
+ type: number
required:
- - type
- - file_id
- - filename
- - index
+ - date
+ - model
+ - model_permaslug
+ - endpoint_id
+ - provider_name
+ - usage
+ - byok_usage_inference
+ - requests
+ - prompt_tokens
+ - completion_tokens
+ - reasoning_tokens
+ type: object
+ ActivityResponse:
example:
- type: file_citation
- file_id: file-abc123
- filename: research_paper.pdf
- index: 0
- URLCitation:
+ data:
+ - byok_usage_inference: 0.012
+ completion_tokens: 125
+ date: '2025-08-24'
+ endpoint_id: 550e8400-e29b-41d4-a716-446655440000
+ model: openai/gpt-4.1
+ model_permaslug: openai/gpt-4.1-2025-04-14
+ prompt_tokens: 50
+ provider_name: OpenAI
+ reasoning_tokens: 25
+ requests: 5
+ usage: 0.015
+ properties:
+ data:
+ description: List of activity items
+ items:
+ $ref: '#/components/schemas/ActivityItem'
+ type: array
+ required:
+ - data
type: object
+ AnnotationAddedEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseAnnotationAddedEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when a text annotation is added to output
+ example:
+ annotation:
+ end_index: 7
+ start_index: 0
+ title: Example
+ type: url_citation
+ url: https://example.com
+ annotation_index: 0
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ sequence_number: 5
+ type: response.output_text.annotation.added
+ AnthropicBase64ImageSource:
+ example:
+ data: /9j/4AAQ...
+ media_type: image/jpeg
+ type: base64
properties:
+ data:
+ type: string
+ media_type:
+ $ref: '#/components/schemas/AnthropicImageMimeType'
type:
+ enum:
+ - base64
+ type: string
+ required:
+ - type
+ - media_type
+ - data
+ type: object
+ AnthropicBase64PdfSource:
+ example:
+ data: JVBERi0x...
+ media_type: application/pdf
+ type: base64
+ properties:
+ data:
type: string
+ media_type:
enum:
- - url_citation
- url:
+ - application/pdf
type: string
- title:
+ type:
+ enum:
+ - base64
type: string
- start_index:
- type: integer
- end_index:
- type: integer
required:
- type
- - url
- - title
- - start_index
- - end_index
+ - media_type
+ - data
+ type: object
+ AnthropicBaseUsageIteration:
example:
- type: url_citation
- start_index: 0
- end_index: 42
- title: OpenRouter Documentation
- url: https://openrouter.ai/docs
- FilePath:
+ cache_creation: null
+ cache_creation_input_tokens: 0
+ cache_read_input_tokens: 0
+ input_tokens: 100
+ output_tokens: 50
+ properties:
+ cache_creation:
+ $ref: '#/components/schemas/AnthropicIterationCacheCreation'
+ cache_creation_input_tokens:
+ type: integer
+ cache_read_input_tokens:
+ type: integer
+ input_tokens:
+ type: integer
+ output_tokens:
+ type: integer
type: object
+ AnthropicBashCodeExecutionContent:
+ discriminator:
+ mapping:
+ bash_code_execution_result: '#/components/schemas/AnthropicBashCodeExecutionResult'
+ bash_code_execution_tool_result_error: '#/components/schemas/AnthropicBashCodeExecutionToolResultError'
+ propertyName: type
+ example:
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: bash_code_execution_result
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResultError'
+ - $ref: '#/components/schemas/AnthropicBashCodeExecutionResult'
+ AnthropicBashCodeExecutionOutput:
+ example:
+ file_id: file_01abc
+ type: bash_code_execution_output
properties:
- type:
+ file_id:
type: string
+ type:
enum:
- - file_path
- file_id:
+ - bash_code_execution_output
type: string
- index:
- type: integer
required:
- - type
- file_id
- - index
+ - type
+ type: object
+ AnthropicBashCodeExecutionResult:
example:
- type: file_path
- file_id: file-xyz789
- index: 0
- OpenAIResponsesAnnotation:
- anyOf:
- - $ref: '#/components/schemas/FileCitation'
- - $ref: '#/components/schemas/URLCitation'
- - $ref: '#/components/schemas/FilePath'
- example:
- type: file_citation
- file_id: file-abc123
- filename: research_paper.pdf
- index: 0
- ResponseOutputText:
- type: object
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: bash_code_execution_result
properties:
- type:
- type: string
- enum:
- - output_text
- text:
- type: string
- annotations:
- type: array
+ content:
items:
- $ref: '#/components/schemas/OpenAIResponsesAnnotation'
- logprobs:
+ $ref: '#/components/schemas/AnthropicBashCodeExecutionOutput'
type: array
- items:
- type: object
- properties:
- token:
- type: string
- bytes:
- type: array
- items:
- type: integer
- logprob:
- type: number
- format: double
- top_logprobs:
- type: array
- items:
- type: object
- properties:
- token:
- type: string
- bytes:
- type: array
- items:
- type: integer
- logprob:
- type: number
- format: double
- required:
- - token
- - bytes
- - logprob
- required:
- - token
- - bytes
- - logprob
- - top_logprobs
- required:
- - type
- - text
- example:
- type: output_text
- text: The capital of France is Paris.
- annotations:
- - type: url_citation
- start_index: 0
- end_index: 42
- title: Paris - Wikipedia
- url: https://en.wikipedia.org/wiki/Paris
- OpenAIResponsesRefusalContent:
- type: object
- properties:
- type:
+ return_code:
+ type: integer
+ stderr:
+ type: string
+ stdout:
type: string
+ type:
enum:
- - refusal
- refusal:
+ - bash_code_execution_result
type: string
required:
+ - content
+ - return_code
+ - stderr
+ - stdout
- type
- - refusal
- example:
- type: refusal
- refusal: I'm sorry, I cannot assist with that request
- OutputMessage:
type: object
+ AnthropicBashCodeExecutionToolResult:
+ example:
+ content:
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: bash_code_execution_result
+ tool_use_id: srvtoolu_01abc
+ type: bash_code_execution_tool_result
properties:
- id:
- type: string
- role:
+ content:
+ $ref: '#/components/schemas/AnthropicBashCodeExecutionContent'
+ tool_use_id:
type: string
- enum:
- - assistant
type:
- type: string
enum:
- - message
- status:
- anyOf:
- - type: string
- enum:
- - completed
- - type: string
- enum:
- - incomplete
- - type: string
- enum:
- - in_progress
- content:
- type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
- phase:
- anyOf:
- - type: string
- enum:
- - commentary
- - type: string
- enum:
- - final_answer
- - nullable: true
- description: >-
- The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer`
- for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve
- and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
+ - bash_code_execution_tool_result
+ type: string
required:
- - id
- - role
- type
- content
- example:
- id: msg-abc123
- role: assistant
- type: message
- status: completed
- content:
- - type: output_text
- text: Hello! How can I help you today?
- OutputMessageItem:
- allOf:
- - $ref: '#/components/schemas/OutputMessage'
- - type: object
- properties: {}
- example:
- id: msg-123
- type: message
- role: assistant
- status: completed
- content:
- - type: output_text
- text: Hello! How can I help you?
- annotations: []
- description: An output message item
- ReasoningTextContent:
+ - tool_use_id
type: object
+ AnthropicBashCodeExecutionToolResultError:
+ example:
+ error_code: unavailable
+ type: bash_code_execution_tool_result_error
properties:
- type:
+ error_code:
+ enum:
+ - invalid_tool_input
+ - unavailable
+ - too_many_requests
+ - execution_time_exceeded
+ - output_file_too_large
type: string
+ type:
enum:
- - reasoning_text
- text:
+ - bash_code_execution_tool_result_error
type: string
required:
+ - error_code
- type
- - text
- example:
- type: reasoning_text
- text: Let me think step by step about this problem...
- ReasoningSummaryText:
type: object
+ AnthropicCacheControlDirective:
+ example:
+ type: ephemeral
properties:
+ ttl:
+ $ref: '#/components/schemas/AnthropicCacheControlTtl'
type:
- type: string
enum:
- - summary_text
- text:
+ - ephemeral
type: string
required:
- type
- - text
- example:
- type: summary_text
- text: Analyzed the problem using first principles
- ReasoningFormat:
+ type: object
+ AnthropicCacheControlTtl:
+ enum:
+ - 5m
+ - 1h
+ example: 5m
type: string
+ AnthropicCacheCreation:
+ example:
+ ephemeral_1h_input_tokens: 0
+ ephemeral_5m_input_tokens: 100
nullable: true
- enum:
- - unknown
- - openai-responses-v1
- - azure-openai-responses-v1
- - xai-responses-v1
- - anthropic-claude-v1
- - google-gemini-v1
- - null
- example: unknown
- OutputItemReasoning:
+ properties:
+ ephemeral_1h_input_tokens:
+ type: integer
+ ephemeral_5m_input_tokens:
+ type: integer
+ required:
+ - ephemeral_5m_input_tokens
+ - ephemeral_1h_input_tokens
type: object
+ AnthropicCaller:
+ discriminator:
+ mapping:
+ code_execution_20250825: '#/components/schemas/AnthropicCodeExecution20250825Caller'
+ code_execution_20260120: '#/components/schemas/AnthropicCodeExecution20260120Caller'
+ direct: '#/components/schemas/AnthropicDirectCaller'
+ propertyName: type
+ example:
+ type: direct
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicDirectCaller'
+ - $ref: '#/components/schemas/AnthropicCodeExecution20250825Caller'
+ - $ref: '#/components/schemas/AnthropicCodeExecution20260120Caller'
+ AnthropicCitationCharLocation:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_char_index: 18
+ file_id: null
+ start_char_index: 0
+ type: char_location
properties:
- type:
+ cited_text:
type: string
- enum:
- - reasoning
- id:
- type: string
- content:
- type: array
- items:
- $ref: '#/components/schemas/ReasoningTextContent'
- summary:
- type: array
- items:
- $ref: '#/components/schemas/ReasoningSummaryText'
- encrypted_content:
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
type: string
+ end_char_index:
+ type: integer
+ file_id:
nullable: true
- status:
- anyOf:
- - type: string
- enum:
- - completed
- - type: string
- enum:
- - incomplete
- - type: string
- enum:
- - in_progress
+ type: string
+ start_char_index:
+ type: integer
+ type:
+ enum:
+ - char_location
+ type: string
required:
- type
- - id
- - summary
- example:
- type: reasoning
- id: reasoning-abc123
- summary:
- - type: summary_text
- text: Analyzed the problem using first principles
- OutputReasoningItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemReasoning'
- - type: object
- properties:
- content:
- type: array
- nullable: true
- items:
- $ref: '#/components/schemas/ReasoningTextContent'
- signature:
- type: string
- nullable: true
- description: A signature for the reasoning content, used for verification
- example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
- format:
- $ref: '#/components/schemas/ReasoningFormat'
- example:
- id: reasoning-123
- type: reasoning
- status: completed
- summary:
- - type: summary_text
- text: Analyzed the problem and found the optimal solution.
- content:
- - type: reasoning_text
- text: First, we analyze the problem...
- signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
- format: anthropic-claude-v1
- description: An output item containing reasoning
- OutputItemFunctionCall:
+ - cited_text
+ - document_index
+ - document_title
+ - start_char_index
+ - end_char_index
+ - file_id
type: object
+ AnthropicCitationCharLocationParam:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_char_index: 18
+ start_char_index: 0
+ type: char_location
properties:
- type:
+ cited_text:
+ type: string
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
type: string
+ end_char_index:
+ type: integer
+ start_char_index:
+ type: integer
+ type:
enum:
- - function_call
- id:
+ - char_location
type: string
- name:
+ required:
+ - type
+ - cited_text
+ - document_index
+ - document_title
+ - start_char_index
+ - end_char_index
+ type: object
+ AnthropicCitationContentBlockLocation:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_block_index: 1
+ file_id: null
+ start_block_index: 0
+ type: content_block_location
+ properties:
+ cited_text:
type: string
- arguments:
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
type: string
- call_id:
+ end_block_index:
+ type: integer
+ file_id:
+ nullable: true
+ type: string
+ start_block_index:
+ type: integer
+ type:
+ enum:
+ - content_block_location
type: string
- status:
- anyOf:
- - type: string
- enum:
- - completed
- - type: string
- enum:
- - incomplete
- - type: string
- enum:
- - in_progress
required:
- type
- - name
- - arguments
- - call_id
- example:
- type: function_call
- id: call-abc123
- name: get_weather
- arguments: '{"location":"San Francisco","unit":"celsius"}'
- call_id: call-abc123
- OutputFunctionCallItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemFunctionCall'
- - type: object
- properties: {}
- example:
- id: fc-abc123
- type: function_call
- call_id: call-abc123
- name: get_weather
- arguments: '{"location":"San Francisco"}'
- status: completed
- WebSearchSource:
+ - cited_text
+ - document_index
+ - document_title
+ - start_block_index
+ - end_block_index
+ - file_id
type: object
+ AnthropicCitationContentBlockLocationParam:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_block_index: 1
+ start_block_index: 0
+ type: content_block_location
properties:
- type:
+ cited_text:
+ type: string
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
type: string
+ end_block_index:
+ type: integer
+ start_block_index:
+ type: integer
+ type:
enum:
- - url
- url:
+ - content_block_location
type: string
required:
- type
- - url
- example:
- type: url
- url: https://example.com/article
- WebSearchStatus:
- type: string
- enum:
- - completed
- - searching
- - in_progress
- - failed
- example: completed
- OutputItemWebSearchCall:
+ - cited_text
+ - document_index
+ - document_title
+ - start_block_index
+ - end_block_index
type: object
+ AnthropicCitationPageLocation:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_page_number: 2
+ file_id: null
+ start_page_number: 1
+ type: page_location
properties:
- type:
+ cited_text:
+ type: string
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
+ type: string
+ end_page_number:
+ type: integer
+ file_id:
+ nullable: true
type: string
+ start_page_number:
+ type: integer
+ type:
enum:
- - web_search_call
- id:
+ - page_location
type: string
- action:
- oneOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - search
- query:
- type: string
- queries:
- type: array
- items:
- type: string
- sources:
- type: array
- items:
- $ref: '#/components/schemas/WebSearchSource'
- required:
- - type
- - query
- - type: object
- properties:
- type:
- type: string
- enum:
- - open_page
- url:
- type: string
- nullable: true
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - find_in_page
- pattern:
- type: string
- url:
- type: string
- required:
- - type
- - pattern
- - url
- status:
- $ref: '#/components/schemas/WebSearchStatus'
required:
- type
- - id
- - action
- - status
- example:
- type: web_search_call
- id: search-abc123
- action:
- type: search
- query: OpenAI API
- status: completed
- OutputWebSearchCallItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemWebSearchCall'
- - type: object
- properties: {}
- example:
- id: ws-abc123
- type: web_search_call
- status: completed
- OutputItemFileSearchCall:
+ - cited_text
+ - document_index
+ - document_title
+ - start_page_number
+ - end_page_number
+ - file_id
type: object
+ AnthropicCitationPageLocationParam:
+ example:
+ cited_text: Example cited text
+ document_index: 0
+ document_title: null
+ end_page_number: 2
+ start_page_number: 1
+ type: page_location
properties:
- type:
+ cited_text:
+ type: string
+ document_index:
+ type: integer
+ document_title:
+ nullable: true
type: string
+ end_page_number:
+ type: integer
+ start_page_number:
+ type: integer
+ type:
enum:
- - file_search_call
- id:
+ - page_location
type: string
- queries:
- type: array
- items:
- type: string
- status:
- $ref: '#/components/schemas/WebSearchStatus'
required:
- type
- - id
- - queries
- - status
- example:
- type: file_search_call
- id: filesearch-abc123
- queries:
- - machine learning algorithms
- - neural networks
- status: completed
- OutputFileSearchCallItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemFileSearchCall'
- - type: object
- properties: {}
+ - cited_text
+ - document_index
+ - document_title
+ - start_page_number
+ - end_page_number
+ type: object
+ AnthropicCitationsConfig:
example:
- id: fs-abc123
- type: file_search_call
- status: completed
- queries:
- - search term
- results: []
- ImageGenerationStatus:
- type: string
- enum:
- - in_progress
- - completed
- - generating
- - failed
- example: completed
- OutputItemImageGenerationCall:
+ enabled: true
+ nullable: true
+ properties:
+ enabled:
+ type: boolean
+ required:
+ - enabled
type: object
+ AnthropicCitationSearchResultLocation:
+ example:
+ cited_text: Example cited text
+ end_block_index: 1
+ search_result_index: 0
+ source: example_source
+ start_block_index: 0
+ title: Example Result
+ type: search_result_location
properties:
- type:
- type: string
- enum:
- - image_generation_call
- id:
+ cited_text:
type: string
- result:
+ end_block_index:
+ type: integer
+ search_result_index:
+ type: integer
+ source:
type: string
+ start_block_index:
+ type: integer
+ title:
nullable: true
- default: null
- status:
- $ref: '#/components/schemas/ImageGenerationStatus'
+ type: string
+ type:
+ enum:
+ - search_result_location
+ type: string
required:
- type
- - id
- - status
- example:
- type: image_generation_call
- id: imagegen-abc123
- result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
- status: completed
- OutputImageGenerationCallItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemImageGenerationCall'
- - type: object
- properties: {}
- example:
- id: img-abc123
- type: image_generation_call
- status: completed
- result: null
- ToolCallStatus:
- type: string
- enum:
- - in_progress
- - completed
- - incomplete
- example: completed
- OutputDatetimeItem:
+ - cited_text
+ - search_result_index
+ - source
+ - title
+ - start_block_index
+ - end_block_index
type: object
+ AnthropicCitationWebSearchResultLocation:
+ example:
+ cited_text: Example cited text
+ encrypted_index: enc_idx_0
+ title: Example Page
+ type: web_search_result_location
+ url: https://example.com
properties:
- id:
+ cited_text:
type: string
- status:
- $ref: '#/components/schemas/ToolCallStatus'
- type:
+ encrypted_index:
+ type: string
+ title:
+ nullable: true
type: string
+ type:
enum:
- - openrouter:datetime
- datetime:
+ - web_search_result_location
type: string
- description: ISO 8601 datetime string
- timezone:
+ url:
type: string
- description: IANA timezone name
required:
- - status
- type
- - datetime
- - timezone
- description: An openrouter:datetime server tool output item
- example:
- type: openrouter:datetime
- id: dt_tmp_abc123
- status: completed
- datetime: '2026-03-12T14:30:00.000Z'
- timezone: UTC
- OutputWebSearchServerToolItem:
+ - cited_text
+ - encrypted_index
+ - title
+ - url
type: object
+ AnthropicCodeExecution20250825Caller:
+ example:
+ tool_id: toolu_01abc
+ type: code_execution_20250825
properties:
- id:
+ tool_id:
type: string
- status:
- $ref: '#/components/schemas/ToolCallStatus'
type:
- type: string
enum:
- - openrouter:web_search
+ - code_execution_20250825
+ type: string
required:
- - status
- type
- description: An openrouter:web_search server tool output item
+ - tool_id
+ type: object
+ AnthropicCodeExecution20260120Caller:
example:
- type: openrouter:web_search
- id: ws_tmp_abc123
- status: completed
- OutputItems:
- oneOf:
- - $ref: '#/components/schemas/OutputMessageItem'
- - $ref: '#/components/schemas/OutputReasoningItem'
- - $ref: '#/components/schemas/OutputFunctionCallItem'
- - $ref: '#/components/schemas/OutputWebSearchCallItem'
- - $ref: '#/components/schemas/OutputFileSearchCallItem'
- - $ref: '#/components/schemas/OutputImageGenerationCallItem'
- - $ref: '#/components/schemas/OutputDatetimeItem'
- - $ref: '#/components/schemas/OutputWebSearchServerToolItem'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OutputMessageItem'
- reasoning: '#/components/schemas/OutputReasoningItem'
- function_call: '#/components/schemas/OutputFunctionCallItem'
- web_search_call: '#/components/schemas/OutputWebSearchCallItem'
- file_search_call: '#/components/schemas/OutputFileSearchCallItem'
- image_generation_call: '#/components/schemas/OutputImageGenerationCallItem'
- openrouter:datetime: '#/components/schemas/OutputDatetimeItem'
- openrouter:web_search: '#/components/schemas/OutputWebSearchServerToolItem'
- description: An output item from the response
- example:
- id: msg-abc123
- role: assistant
- type: message
- status: completed
- content:
- - type: output_text
- text: Hello! How can I help you today?
- ResponsesErrorField:
- type: object
- nullable: true
+ tool_id: toolu_01abc
+ type: code_execution_20260120
properties:
- code:
+ tool_id:
type: string
+ type:
enum:
- - server_error
- - rate_limit_exceeded
- - invalid_prompt
- - vector_store_timeout
- - invalid_image
- - invalid_image_format
- - invalid_base64_image
- - invalid_image_url
- - image_too_large
- - image_too_small
- - image_parse_error
- - image_content_policy_violation
- - invalid_image_mode
- - image_file_too_large
- - unsupported_image_media_type
- - empty_image_file
- - failed_to_download_image
- - image_file_not_found
- message:
+ - code_execution_20260120
type: string
required:
- - code
- - message
- description: Error information returned from the API
- example:
- code: rate_limit_exceeded
- message: Rate limit exceeded. Please try again later.
- IncompleteDetails:
+ - type
+ - tool_id
type: object
- nullable: true
+ AnthropicCodeExecutionContent:
+ discriminator:
+ mapping:
+ code_execution_result: '#/components/schemas/AnthropicCodeExecutionResult'
+ code_execution_tool_result_error: '#/components/schemas/AnthropicCodeExecutionToolResultError'
+ encrypted_code_execution_result: '#/components/schemas/AnthropicEncryptedCodeExecutionResult'
+ propertyName: type
+ example:
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: code_execution_result
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicCodeExecutionToolResultError'
+ - $ref: '#/components/schemas/AnthropicCodeExecutionResult'
+ - $ref: '#/components/schemas/AnthropicEncryptedCodeExecutionResult'
+ AnthropicCodeExecutionOutput:
+ example:
+ file_id: file_01abc
+ type: code_execution_output
properties:
- reason:
+ file_id:
type: string
+ type:
enum:
- - max_output_tokens
- - content_filter
- example:
- reason: max_output_tokens
- OpenAIResponsesUsage:
- type: object
- properties:
- input_tokens:
- type: integer
- input_tokens_details:
- type: object
- properties:
- cached_tokens:
- type: integer
- required:
- - cached_tokens
- output_tokens:
- type: integer
- output_tokens_details:
- type: object
- properties:
- reasoning_tokens:
- type: integer
- required:
- - reasoning_tokens
- total_tokens:
- type: integer
+ - code_execution_output
+ type: string
required:
- - input_tokens
- - input_tokens_details
- - output_tokens
- - output_tokens_details
- - total_tokens
- example:
- input_tokens: 100
- input_tokens_details:
- cached_tokens: 0
- output_tokens: 50
- output_tokens_details:
- reasoning_tokens: 0
- total_tokens: 150
- Usage:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesUsage'
- - type: object
- nullable: true
- properties:
- cost:
- type: number
- format: double
- description: Cost of the completion
- is_byok:
- type: boolean
- description: Whether a request was made using a Bring Your Own Key configuration
- cost_details:
- type: object
- properties:
- upstream_inference_cost:
- type: number
- format: double
- upstream_inference_input_cost:
- type: number
- format: double
- upstream_inference_output_cost:
- type: number
- format: double
- required:
- - upstream_inference_input_cost
- - upstream_inference_output_cost
- example:
- input_tokens: 10
- output_tokens: 25
- total_tokens: 35
- input_tokens_details:
- cached_tokens: 0
- output_tokens_details:
- reasoning_tokens: 0
- cost: 0.0012
- cost_details:
- upstream_inference_cost: null
- upstream_inference_input_cost: 0.0008
- upstream_inference_output_cost: 0.0004
- description: Token usage information for the response
- InputText:
+ - file_id
+ - type
type: object
+ AnthropicCodeExecutionResult:
+ example:
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: code_execution_result
properties:
- type:
+ content:
+ items:
+ $ref: '#/components/schemas/AnthropicCodeExecutionOutput'
+ type: array
+ return_code:
+ type: integer
+ stderr:
type: string
+ stdout:
+ type: string
+ type:
enum:
- - input_text
- text:
+ - code_execution_result
type: string
required:
+ - content
+ - return_code
+ - stderr
+ - stdout
- type
- - text
- description: Text input content item
- example:
- type: input_text
- text: Hello, how can I help you?
- InputImage:
type: object
+ AnthropicCodeExecutionToolResult:
+ example:
+ content:
+ content: []
+ return_code: 0
+ stderr: ''
+ stdout: Hello
+ type: code_execution_result
+ tool_use_id: srvtoolu_01abc
+ type: code_execution_tool_result
properties:
- type:
- type: string
- enum:
- - input_image
- detail:
+ content:
+ $ref: '#/components/schemas/AnthropicCodeExecutionContent'
+ tool_use_id:
type: string
+ type:
enum:
- - auto
- - high
- - low
- image_url:
+ - code_execution_tool_result
type: string
- nullable: true
required:
- type
- - detail
- description: Image input content item
- example:
- type: input_image
- detail: auto
- image_url: https://example.com/image.jpg
- InputFile:
+ - content
+ - tool_use_id
type: object
+ AnthropicCodeExecutionToolResultError:
+ example:
+ error_code: unavailable
+ type: code_execution_tool_result_error
properties:
+ error_code:
+ $ref: '#/components/schemas/AnthropicServerToolErrorCode'
type:
- type: string
enum:
- - input_file
- file_id:
+ - code_execution_tool_result_error
type: string
+ required:
+ - error_code
+ - type
+ type: object
+ AnthropicCompactionBlock:
+ example:
+ content: Compacted summary of conversation.
+ type: compaction
+ properties:
+ content:
nullable: true
- file_data:
- type: string
- filename:
type: string
- file_url:
+ type:
+ enum:
+ - compaction
type: string
required:
- type
- description: File input content item
- example:
- type: input_file
- file_id: file-abc123
- filename: document.pdf
- InputAudio:
+ - content
type: object
- properties:
- type:
- type: string
- enum:
- - input_audio
- input_audio:
- type: object
- properties:
- data:
- type: string
- format:
- type: string
+ AnthropicCompactionUsageIteration:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
+ - properties:
+ type:
enum:
- - mp3
- - wav
+ - compaction
+ type: string
required:
- - data
- - format
- required:
- - type
- - input_audio
- description: Audio input content item
+ - type
+ type: object
example:
- type: input_audio
- input_audio:
- data: SGVsbG8gV29ybGQ=
- format: mp3
- OpenAIResponseInputMessageItem:
- type: object
+ cache_creation: null
+ cache_creation_input_tokens: 0
+ cache_read_input_tokens: 0
+ input_tokens: 50
+ output_tokens: 25
+ type: compaction
+ AnthropicContainer:
+ example:
+ expires_at: '2026-04-08T00:00:00Z'
+ id: ctr_01abc
+ nullable: true
properties:
- id:
+ expires_at:
type: string
- type:
+ id:
type: string
- enum:
- - message
- role:
- anyOf:
- - type: string
- enum:
- - user
- - type: string
- enum:
- - system
- - type: string
- enum:
- - developer
- content:
- type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - $ref: '#/components/schemas/InputImage'
- - $ref: '#/components/schemas/InputFile'
- - $ref: '#/components/schemas/InputAudio'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/InputText'
- input_image: '#/components/schemas/InputImage'
- input_file: '#/components/schemas/InputFile'
- input_audio: '#/components/schemas/InputAudio'
required:
- id
- - role
- - content
- example:
- id: msg-abc123
- type: message
- role: user
- content:
- - type: input_text
- text: Hello, how are you?
- OpenAIResponseFunctionToolCallOutput:
+ - expires_at
type: object
+ AnthropicContainerUpload:
+ example:
+ file_id: file_01abc
+ type: container_upload
properties:
+ file_id:
+ type: string
type:
+ enum:
+ - container_upload
type: string
+ required:
+ - type
+ - file_id
+ type: object
+ AnthropicDirectCaller:
+ example:
+ type: direct
+ properties:
+ type:
enum:
- - function_call_output
- id:
+ - direct
type: string
+ required:
+ - type
+ type: object
+ AnthropicDocumentBlock:
+ example:
+ citations: null
+ source:
+ data: Hello, world!
+ media_type: text/plain
+ type: text
+ title: null
+ type: document
+ properties:
+ citations:
+ $ref: '#/components/schemas/AnthropicCitationsConfig'
+ source:
+ anyOf:
+ - $ref: '#/components/schemas/AnthropicBase64PdfSource'
+ - $ref: '#/components/schemas/AnthropicPlainTextSource'
+ title:
nullable: true
- call_id:
type: string
- output:
- anyOf:
- - type: string
- - type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - $ref: '#/components/schemas/InputImage'
- - $ref: '#/components/schemas/InputFile'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/InputText'
- input_image: '#/components/schemas/InputImage'
- input_file: '#/components/schemas/InputFile'
- status:
- allOf:
- - $ref: '#/components/schemas/ToolCallStatus'
- - nullable: true
+ type:
+ enum:
+ - document
+ type: string
required:
+ - citations
+ - source
+ - title
- type
- - call_id
- - output
- example:
- type: function_call_output
- call_id: call-abc123
- output: '{"temperature":72,"conditions":"sunny"}'
- OpenAIResponseFunctionToolCall:
type: object
+ AnthropicDocumentBlockParam:
+ example:
+ source:
+ data: Hello, world!
+ media_type: text/plain
+ type: text
+ type: document
properties:
- type:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ citations:
+ nullable: true
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ context:
+ nullable: true
+ type: string
+ source:
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicBase64PdfSource'
+ - $ref: '#/components/schemas/AnthropicPlainTextSource'
+ - properties:
+ content:
+ anyOf:
+ - type: string
+ - items:
+ discriminator:
+ mapping:
+ image: '#/components/schemas/AnthropicImageBlockParam'
+ text: '#/components/schemas/AnthropicTextBlockParam'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicTextBlockParam'
+ - $ref: '#/components/schemas/AnthropicImageBlockParam'
+ type: array
+ type:
+ enum:
+ - content
+ type: string
+ required:
+ - type
+ - content
+ type: object
+ - $ref: '#/components/schemas/AnthropicUrlPdfSource'
+ title:
+ nullable: true
type: string
+ type:
enum:
- - function_call
- call_id:
+ - document
type: string
- name:
+ required:
+ - type
+ - source
+ type: object
+ AnthropicEncryptedCodeExecutionResult:
+ example:
+ content: []
+ encrypted_stdout: enc_stdout
+ return_code: 0
+ stderr: ''
+ type: encrypted_code_execution_result
+ properties:
+ content:
+ items:
+ $ref: '#/components/schemas/AnthropicCodeExecutionOutput'
+ type: array
+ encrypted_stdout:
type: string
- arguments:
+ return_code:
+ type: integer
+ stderr:
type: string
- id:
+ type:
+ enum:
+ - encrypted_code_execution_result
type: string
- status:
- $ref: '#/components/schemas/ToolCallStatus'
required:
+ - content
+ - encrypted_stdout
+ - return_code
+ - stderr
- type
- - call_id
- - name
- - arguments
+ type: object
+ AnthropicImageBlockParam:
example:
- type: function_call
- call_id: call-abc123
- name: get_weather
- arguments: '{"location":"San Francisco"}'
- id: fc-abc123
- status: completed
- BaseInputs:
- anyOf:
- - type: string
- - type: array
- items:
- anyOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - message
- role:
- anyOf:
- - type: string
- enum:
- - user
- - type: string
- enum:
- - system
- - type: string
- enum:
- - assistant
- - type: string
- enum:
- - developer
- content:
- anyOf:
- - type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - $ref: '#/components/schemas/InputImage'
- - $ref: '#/components/schemas/InputFile'
- - $ref: '#/components/schemas/InputAudio'
- discriminator:
- propertyName: type
- mapping:
- input_text: '#/components/schemas/InputText'
- input_image: '#/components/schemas/InputImage'
- input_file: '#/components/schemas/InputFile'
- input_audio: '#/components/schemas/InputAudio'
- - type: string
- phase:
- anyOf:
- - type: string
- enum:
- - commentary
- - type: string
- enum:
- - final_answer
- - nullable: true
- required:
- - role
- - content
- - $ref: '#/components/schemas/OpenAIResponseInputMessageItem'
- - $ref: '#/components/schemas/OpenAIResponseFunctionToolCallOutput'
- - $ref: '#/components/schemas/OpenAIResponseFunctionToolCall'
- - $ref: '#/components/schemas/OutputItemImageGenerationCall'
- - $ref: '#/components/schemas/OutputMessage'
- - nullable: true
- example:
- - role: user
- content: What is the weather today?
- RequestMetadata:
- type: object
- nullable: true
- additionalProperties:
- type: string
- maxLength: 512
- description: >-
- Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must
- be ≤512 characters. Maximum 16 pairs allowed.
- example:
- user_id: '123'
- session_id: abc-def-ghi
- FunctionTool:
- type: object
+ source:
+ data: /9j/4AAQ...
+ media_type: image/jpeg
+ type: base64
+ type: image
properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ source:
+ discriminator:
+ mapping:
+ base64: '#/components/schemas/AnthropicBase64ImageSource'
+ url: '#/components/schemas/AnthropicUrlImageSource'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicBase64ImageSource'
+ - $ref: '#/components/schemas/AnthropicUrlImageSource'
type:
- type: string
enum:
- - function
- name:
- type: string
- description:
+ - image
type: string
- nullable: true
- strict:
- type: boolean
- nullable: true
- parameters:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- type
- - name
- - parameters
- description: Function tool definition
- example:
- type: function
- name: get_weather
- description: Get the current weather in a location
- parameters:
- type: object
- properties:
- location:
- type: string
- description: The city and state
- unit:
- type: string
- enum:
- - celsius
- - fahrenheit
- required:
- - location
- SearchContextSizeEnum:
- type: string
- enum:
- - low
- - medium
- - high
- description: Size of the search context for web search tools
- example: medium
- Preview_WebSearchUserLocation:
+ - source
type: object
+ AnthropicImageMimeType:
+ enum:
+ - image/jpeg
+ - image/png
+ - image/gif
+ - image/webp
+ example: image/jpeg
+ type: string
+ AnthropicInputTokensClearAtLeast:
+ example:
+ type: input_tokens
+ value: 50000
nullable: true
properties:
type:
- type: string
enum:
- - approximate
- city:
- type: string
- nullable: true
- country:
- type: string
- nullable: true
- region:
- type: string
- nullable: true
- timezone:
+ - input_tokens
type: string
- nullable: true
+ value:
+ type: integer
required:
- type
- example:
- type: approximate
- city: San Francisco
- country: USA
- region: California
- timezone: America/Los_Angeles
- WebSearchEngineEnum:
- type: string
- enum:
- - auto
- - native
- - exa
- - firecrawl
- - parallel
- description: >-
- Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native"
- forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires
- BYOK). "parallel" uses the Parallel search API.
- example: auto
- WebSearchDomainFilter:
+ - value
type: object
- nullable: true
- properties:
- allowed_domains:
- type: array
- nullable: true
- items:
- type: string
- excluded_domains:
- type: array
- nullable: true
- items:
- type: string
+ AnthropicInputTokensTrigger:
example:
- allowed_domains:
- - example.com
- excluded_domains:
- - spam.com
- Preview_WebSearchServerTool:
- type: object
+ type: input_tokens
+ value: 100000
properties:
type:
- type: string
enum:
- - web_search_preview
- search_context_size:
- $ref: '#/components/schemas/SearchContextSizeEnum'
- user_location:
- $ref: '#/components/schemas/Preview_WebSearchUserLocation'
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
+ - input_tokens
+ type: string
+ value:
type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
- filters:
- $ref: '#/components/schemas/WebSearchDomainFilter'
required:
- type
- description: Web search preview tool configuration
- example:
- type: web_search_preview
- Preview_20250311_WebSearchServerTool:
+ - value
type: object
+ AnthropicIterationCacheCreation:
+ default: null
+ example:
+ ephemeral_1h_input_tokens: 0
+ ephemeral_5m_input_tokens: 0
+ nullable: true
properties:
- type:
- type: string
- enum:
- - web_search_preview_2025_03_11
- search_context_size:
- $ref: '#/components/schemas/SearchContextSizeEnum'
- user_location:
- $ref: '#/components/schemas/Preview_WebSearchUserLocation'
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
+ ephemeral_1h_input_tokens:
+ type: integer
+ ephemeral_5m_input_tokens:
type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
- filters:
- $ref: '#/components/schemas/WebSearchDomainFilter'
- required:
- - type
- description: Web search preview tool configuration (2025-03-11 version)
- example:
- type: web_search_preview_2025_03_11
- WebSearchUserLocation:
type: object
- nullable: true
+ AnthropicMessageUsageIteration:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
+ - properties:
+ type:
+ enum:
+ - message
+ type: string
+ required:
+ - type
+ type: object
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: 0
+ cache_read_input_tokens: 0
+ input_tokens: 100
+ output_tokens: 50
+ type: message
+ AnthropicPlainTextSource:
+ example:
+ data: Hello, world!
+ media_type: text/plain
+ type: text
properties:
- type:
+ data:
type: string
+ media_type:
enum:
- - approximate
- city:
- type: string
- nullable: true
- country:
- type: string
- nullable: true
- region:
+ - text/plain
type: string
- nullable: true
- timezone:
+ type:
+ enum:
+ - text
type: string
- nullable: true
- description: User location information for web search
- example:
- type: approximate
- city: San Francisco
- country: USA
- region: California
- timezone: America/Los_Angeles
- Legacy_WebSearchServerTool:
+ required:
+ - type
+ - media_type
+ - data
type: object
+ AnthropicRedactedThinkingBlock:
+ example:
+ data: cmVkYWN0ZWQ=
+ type: redacted_thinking
properties:
- type:
+ data:
type: string
+ type:
enum:
- - web_search
- filters:
- $ref: '#/components/schemas/WebSearchDomainFilter'
- search_context_size:
- $ref: '#/components/schemas/SearchContextSizeEnum'
- user_location:
- $ref: '#/components/schemas/WebSearchUserLocation'
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
- type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
+ - redacted_thinking
+ type: string
required:
- type
- description: Web search tool configuration
- example:
- type: web_search
- engine: auto
- filters:
- allowed_domains:
- - example.com
- WebSearchServerTool:
+ - data
type: object
+ AnthropicSearchResultBlockParam:
+ example:
+ content:
+ - text: Result content
+ type: text
+ source: example_source
+ title: Example Result
+ type: search_result
properties:
- type:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ citations:
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ content:
+ items:
+ $ref: '#/components/schemas/AnthropicTextBlockParam'
+ type: array
+ source:
+ type: string
+ title:
type: string
+ type:
enum:
- - web_search_2025_08_26
- filters:
- $ref: '#/components/schemas/WebSearchDomainFilter'
- search_context_size:
- $ref: '#/components/schemas/SearchContextSizeEnum'
- user_location:
- $ref: '#/components/schemas/WebSearchUserLocation'
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
- type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
+ - search_result
+ type: string
required:
- type
- description: Web search tool configuration (2025-08-26 version)
+ - source
+ - title
+ - content
+ type: object
+ AnthropicServerToolErrorCode:
+ enum:
+ - invalid_tool_input
+ - unavailable
+ - too_many_requests
+ - execution_time_exceeded
+ example: unavailable
+ type: string
+ AnthropicServerToolName:
+ enum:
+ - web_search
+ - web_fetch
+ - code_execution
+ - bash_code_execution
+ - text_editor_code_execution
+ - tool_search_tool_regex
+ - tool_search_tool_bm25
+ example: web_search
+ type: string
+ AnthropicServerToolUsage:
example:
- type: web_search_2025_08_26
- engine: auto
- filters:
- allowed_domains:
- - example.com
- CompoundFilter:
+ web_fetch_requests: 0
+ web_search_requests: 1
+ nullable: true
+ properties:
+ web_fetch_requests:
+ type: integer
+ web_search_requests:
+ type: integer
+ required:
+ - web_search_requests
+ - web_fetch_requests
type: object
+ AnthropicServerToolUseBlock:
+ example:
+ caller:
+ type: direct
+ id: srvtoolu_01abc
+ input:
+ query: latest news
+ name: web_search
+ type: server_tool_use
properties:
- type:
+ caller:
+ $ref: '#/components/schemas/AnthropicCaller'
+ id:
type: string
+ input:
+ nullable: true
+ name:
+ $ref: '#/components/schemas/AnthropicServerToolName'
+ type:
enum:
- - and
- - or
- filters:
- type: array
- items:
- type: object
- additionalProperties:
- nullable: true
+ - server_tool_use
+ type: string
required:
- type
- - filters
- description: A compound filter that combines multiple comparison or compound filters
- example:
- type: and
- filters:
- - key: author
- type: eq
- value: Alice
- FileSearchServerTool:
+ - id
+ - caller
+ - name
type: object
+ AnthropicServiceTier:
+ enum:
+ - standard
+ - priority
+ - batch
+ - null
+ example: standard
+ nullable: true
+ type: string
+ AnthropicSpeed:
+ enum:
+ - fast
+ - standard
+ - null
+ example: standard
+ nullable: true
+ type: string
+ AnthropicTextBlock:
+ example:
+ citations: null
+ text: Hello, world!
+ type: text
properties:
- type:
+ citations:
+ items:
+ $ref: '#/components/schemas/AnthropicTextCitation'
+ nullable: true
+ type: array
+ text:
type: string
+ type:
enum:
- - file_search
- vector_store_ids:
- type: array
- items:
- type: string
- filters:
- anyOf:
- - type: object
- properties:
- key:
- type: string
- type:
- type: string
- enum:
- - eq
- - ne
- - gt
- - gte
- - lt
- - lte
- value:
- anyOf:
- - type: string
- - type: number
- format: double
- - type: boolean
- - type: array
- items:
- anyOf:
- - type: string
- - type: number
- format: double
- required:
- - key
- - type
- - value
- - $ref: '#/components/schemas/CompoundFilter'
- - nullable: true
- max_num_results:
- type: integer
- ranking_options:
- type: object
- properties:
- ranker:
- type: string
- enum:
- - auto
- - default-2024-11-15
- score_threshold:
- type: number
- format: double
+ - text
+ type: string
required:
- type
- - vector_store_ids
- description: File search tool configuration
- example:
- type: file_search
- vector_store_ids:
- - vs_abc123
- ComputerUseServerTool:
+ - text
+ - citations
type: object
+ AnthropicTextBlockParam:
+ example:
+ text: Hello, world!
+ type: text
properties:
- type:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ citations:
+ items:
+ discriminator:
+ mapping:
+ char_location: '#/components/schemas/AnthropicCitationCharLocationParam'
+ content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocationParam'
+ page_location: '#/components/schemas/AnthropicCitationPageLocationParam'
+ search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicCitationCharLocationParam'
+ - $ref: '#/components/schemas/AnthropicCitationPageLocationParam'
+ - $ref: '#/components/schemas/AnthropicCitationContentBlockLocationParam'
+ - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
+ - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ nullable: true
+ type: array
+ text:
type: string
+ type:
enum:
- - computer_use_preview
- display_height:
- type: integer
- display_width:
- type: integer
- environment:
+ - text
type: string
- enum:
- - windows
- - mac
- - linux
- - ubuntu
- - browser
required:
- type
- - display_height
- - display_width
- - environment
- description: Computer use preview tool configuration
- example:
- type: computer_use_preview
- display_height: 768
- display_width: 1024
- environment: linux
- CodeInterpreterServerTool:
+ - text
type: object
+ AnthropicTextCitation:
+ discriminator:
+ mapping:
+ char_location: '#/components/schemas/AnthropicCitationCharLocation'
+ content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation'
+ page_location: '#/components/schemas/AnthropicCitationPageLocation'
+ search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
+ propertyName: type
+ example:
+ cited_text: Example text
+ document_index: 0
+ document_title: null
+ end_char_index: 10
+ file_id: null
+ start_char_index: 0
+ type: char_location
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicCitationCharLocation'
+ - $ref: '#/components/schemas/AnthropicCitationPageLocation'
+ - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation'
+ - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
+ - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ AnthropicTextEditorCodeExecutionContent:
+ discriminator:
+ mapping:
+ text_editor_code_execution_create_result: '#/components/schemas/AnthropicTextEditorCodeExecutionCreateResult'
+ text_editor_code_execution_str_replace_result: '#/components/schemas/AnthropicTextEditorCodeExecutionStrReplaceResult'
+ text_editor_code_execution_tool_result_error: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResultError'
+ text_editor_code_execution_view_result: '#/components/schemas/AnthropicTextEditorCodeExecutionViewResult'
+ propertyName: type
+ example:
+ content: file content
+ file_type: text
+ num_lines: 10
+ start_line: 1
+ total_lines: 10
+ type: text_editor_code_execution_view_result
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResultError'
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionViewResult'
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionCreateResult'
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionStrReplaceResult'
+ AnthropicTextEditorCodeExecutionCreateResult:
+ example:
+ is_file_update: false
+ type: text_editor_code_execution_create_result
properties:
+ is_file_update:
+ type: boolean
type:
- type: string
enum:
- - code_interpreter
- container:
- anyOf:
- - type: string
- - type: object
- properties:
- type:
- type: string
- enum:
- - auto
- file_ids:
- type: array
- items:
- type: string
- memory_limit:
- type: string
- nullable: true
- enum:
- - 1g
- - 4g
- - 16g
- - 64g
- - null
- required:
- - type
+ - text_editor_code_execution_create_result
+ type: string
required:
+ - is_file_update
- type
- - container
- description: Code interpreter tool configuration
- example:
- type: code_interpreter
- container: auto
- McpServerTool:
type: object
+ AnthropicTextEditorCodeExecutionStrReplaceResult:
+ example:
+ lines: null
+ new_lines: null
+ new_start: null
+ old_lines: null
+ old_start: null
+ type: text_editor_code_execution_str_replace_result
properties:
+ lines:
+ items:
+ type: string
+ nullable: true
+ type: array
+ new_lines:
+ type: integer
+ new_start:
+ type: integer
+ old_lines:
+ type: integer
+ old_start:
+ type: integer
type:
- type: string
enum:
- - mcp
- server_label:
+ - text_editor_code_execution_str_replace_result
type: string
- allowed_tools:
- anyOf:
- - type: array
- items:
- type: string
- - type: object
- properties:
- tool_names:
- type: array
- items:
- type: string
- read_only:
- type: boolean
- - nullable: true
- authorization:
+ required:
+ - lines
+ - new_lines
+ - new_start
+ - old_lines
+ - old_start
+ - type
+ type: object
+ AnthropicTextEditorCodeExecutionToolResult:
+ example:
+ content:
+ content: file content
+ file_type: text
+ num_lines: 10
+ start_line: 1
+ total_lines: 10
+ type: text_editor_code_execution_view_result
+ tool_use_id: srvtoolu_01abc
+ type: text_editor_code_execution_tool_result
+ properties:
+ content:
+ $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionContent'
+ tool_use_id:
type: string
- connector_id:
+ type:
+ enum:
+ - text_editor_code_execution_tool_result
type: string
+ required:
+ - type
+ - content
+ - tool_use_id
+ type: object
+ AnthropicTextEditorCodeExecutionToolResultError:
+ example:
+ error_code: unavailable
+ error_message: null
+ type: text_editor_code_execution_tool_result_error
+ properties:
+ error_code:
enum:
- - connector_dropbox
- - connector_gmail
- - connector_googlecalendar
- - connector_googledrive
- - connector_microsoftteams
- - connector_outlookcalendar
- - connector_outlookemail
- - connector_sharepoint
- headers:
- type: object
+ - invalid_tool_input
+ - unavailable
+ - too_many_requests
+ - execution_time_exceeded
+ - file_not_found
+ type: string
+ error_message:
nullable: true
- additionalProperties:
- type: string
- require_approval:
- anyOf:
- - type: object
- properties:
- never:
- type: object
- properties:
- tool_names:
- type: array
- items:
- type: string
- always:
- type: object
- properties:
- tool_names:
- type: array
- items:
- type: string
- - type: string
- enum:
- - always
- - type: string
- enum:
- - never
- - nullable: true
- server_description:
type: string
- server_url:
+ type:
+ enum:
+ - text_editor_code_execution_tool_result_error
type: string
required:
+ - error_code
+ - error_message
- type
- - server_label
- description: MCP (Model Context Protocol) tool configuration
- example:
- type: mcp
- server_label: my-server
- server_url: https://example.com/mcp
- ImageGenerationServerTool:
type: object
+ AnthropicTextEditorCodeExecutionViewResult:
+ example:
+ content: file content
+ file_type: text
+ num_lines: 10
+ start_line: 1
+ total_lines: 10
+ type: text_editor_code_execution_view_result
properties:
- type:
- type: string
- enum:
- - image_generation
- background:
- type: string
- enum:
- - transparent
- - opaque
- - auto
- input_fidelity:
- type: string
- nullable: true
- enum:
- - high
- - low
- - null
- input_image_mask:
- type: object
- properties:
- image_url:
- type: string
- file_id:
- type: string
- model:
+ content:
type: string
+ file_type:
enum:
- - gpt-image-1
- - gpt-image-1-mini
- moderation:
+ - text
+ - image
+ - pdf
type: string
- enum:
- - auto
- - low
- output_compression:
+ num_lines:
type: integer
- output_format:
- type: string
- enum:
- - png
- - webp
- - jpeg
- partial_images:
+ start_line:
type: integer
- quality:
- type: string
+ total_lines:
+ type: integer
+ type:
enum:
- - low
- - medium
- - high
- - auto
- size:
+ - text_editor_code_execution_view_result
type: string
- enum:
- - 1024x1024
- - 1024x1536
- - 1536x1024
- - auto
required:
+ - content
+ - file_type
+ - num_lines
+ - start_line
+ - total_lines
- type
- description: Image generation tool configuration
- example:
- type: image_generation
- quality: high
- CodexLocalShellTool:
type: object
+ AnthropicThinkingBlock:
+ example:
+ signature: sig_abc123
+ thinking: Let me think about this...
+ type: thinking
properties:
- type:
+ signature:
+ type: string
+ thinking:
type: string
+ type:
enum:
- - local_shell
+ - thinking
+ type: string
required:
- type
- description: Local shell tool configuration
- example:
- type: local_shell
- ShellServerTool:
+ - thinking
+ - signature
type: object
+ AnthropicThinkingTurns:
+ example:
+ type: thinking_turns
+ value: 3
properties:
type:
- type: string
enum:
- - shell
+ - thinking_turns
+ type: string
+ value:
+ type: integer
required:
- type
- description: Shell tool configuration
- example:
- type: shell
- ApplyPatchServerTool:
+ - value
type: object
+ AnthropicToolReference:
+ example:
+ tool_name: my_tool
+ type: tool_reference
properties:
- type:
+ tool_name:
type: string
+ type:
enum:
- - apply_patch
+ - tool_reference
+ type: string
required:
+ - tool_name
- type
- description: Apply patch tool configuration
- example:
- type: apply_patch
- CustomTool:
type: object
+ AnthropicToolSearchContent:
+ discriminator:
+ mapping:
+ tool_search_tool_result_error: '#/components/schemas/AnthropicToolSearchResultError'
+ tool_search_tool_search_result: '#/components/schemas/AnthropicToolSearchResult'
+ propertyName: type
+ example:
+ tool_references:
+ - tool_name: my_tool
+ type: tool_reference
+ type: tool_search_tool_search_result
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicToolSearchResultError'
+ - $ref: '#/components/schemas/AnthropicToolSearchResult'
+ AnthropicToolSearchResult:
+ example:
+ tool_references:
+ - tool_name: my_tool
+ type: tool_reference
+ type: tool_search_tool_search_result
properties:
+ tool_references:
+ items:
+ $ref: '#/components/schemas/AnthropicToolReference'
+ type: array
type:
- type: string
enum:
- - custom
- name:
- type: string
- description:
+ - tool_search_tool_search_result
type: string
- format:
- anyOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - text
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - grammar
- definition:
- type: string
- syntax:
- type: string
- enum:
- - lark
- - regex
- required:
- - type
- - definition
- - syntax
required:
+ - tool_references
- type
- - name
- description: Custom tool configuration
- example:
- type: custom
- name: my_tool
- ToolChoiceAllowed:
type: object
+ AnthropicToolSearchResultError:
+ example:
+ error_code: unavailable
+ error_message: null
+ type: tool_search_tool_result_error
properties:
- type:
+ error_code:
+ $ref: '#/components/schemas/AnthropicServerToolErrorCode'
+ error_message:
+ nullable: true
type: string
+ type:
enum:
- - allowed_tools
- mode:
- anyOf:
- - type: string
- enum:
- - auto
- - type: string
- enum:
- - required
- tools:
- type: array
- items:
- type: object
- additionalProperties:
- nullable: true
+ - tool_search_tool_result_error
+ type: string
required:
+ - error_code
+ - error_message
- type
- - mode
- - tools
- description: Constrains the model to a pre-defined set of allowed tools
+ type: object
+ AnthropicToolSearchToolResult:
example:
- type: allowed_tools
- mode: auto
- tools:
- - type: function
- name: get_weather
- OpenAIResponsesToolChoice:
- anyOf:
- - type: string
- enum:
- - auto
- - type: string
- enum:
- - none
- - type: string
+ content:
+ tool_references:
+ - tool_name: my_tool
+ type: tool_reference
+ type: tool_search_tool_search_result
+ tool_use_id: srvtoolu_01abc
+ type: tool_search_tool_result
+ properties:
+ content:
+ $ref: '#/components/schemas/AnthropicToolSearchContent'
+ tool_use_id:
+ type: string
+ type:
enum:
- - required
- - type: object
- properties:
- type:
- type: string
- enum:
- - function
- name:
- type: string
- required:
- - type
- - name
- - type: object
- properties:
- type:
- anyOf:
- - type: string
- enum:
- - web_search_preview_2025_03_11
- - type: string
- enum:
- - web_search_preview
- required:
- - type
- - $ref: '#/components/schemas/ToolChoiceAllowed'
- example: auto
- StoredPromptTemplate:
+ - tool_search_tool_result
+ type: string
+ required:
+ - type
+ - content
+ - tool_use_id
type: object
- nullable: true
+ AnthropicToolUseBlock:
+ example:
+ caller:
+ type: direct
+ id: toolu_01abc
+ input:
+ location: San Francisco
+ name: get_weather
+ type: tool_use
properties:
+ caller:
+ $ref: '#/components/schemas/AnthropicCaller'
id:
type: string
- variables:
- type: object
+ input:
nullable: true
- additionalProperties:
- anyOf:
- - type: string
- - $ref: '#/components/schemas/InputText'
- - $ref: '#/components/schemas/InputImage'
- - $ref: '#/components/schemas/InputFile'
+ name:
+ type: string
+ type:
+ enum:
+ - tool_use
+ type: string
required:
+ - type
- id
- example:
- id: prompt-abc123
- variables:
- name: John
- ReasoningEffort:
- type: string
- nullable: true
- enum:
- - xhigh
- - high
- - medium
- - low
- - minimal
- - none
- - null
- example: medium
- ReasoningSummaryVerbosity:
- type: string
- nullable: true
- enum:
- - auto
- - concise
- - detailed
- - null
- example: auto
- BaseReasoningConfig:
+ - caller
+ - name
type: object
- nullable: true
- properties:
- effort:
- $ref: '#/components/schemas/ReasoningEffort'
- summary:
- $ref: '#/components/schemas/ReasoningSummaryVerbosity'
+ AnthropicToolUsesKeep:
example:
- effort: medium
- summary: auto
- Truncation:
- type: string
- nullable: true
- enum:
- - auto
- - disabled
- - null
- example: auto
- FormatTextConfig:
- type: object
+ type: tool_uses
+ value: 5
properties:
type:
- type: string
enum:
- - text
+ - tool_uses
+ type: string
+ value:
+ type: integer
required:
- type
- description: Plain text response format
- example:
- type: text
- FormatJsonObjectConfig:
+ - value
type: object
+ AnthropicToolUsesTrigger:
+ example:
+ type: tool_uses
+ value: 10
properties:
type:
- type: string
enum:
- - json_object
+ - tool_uses
+ type: string
+ value:
+ type: integer
required:
- type
- description: JSON object response format
- example:
- type: json_object
- FormatJsonSchemaConfig:
+ - value
type: object
+ AnthropicUnknownUsageIteration:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
+ - properties:
+ type:
+ type: string
+ required:
+ - type
+ type: object
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: 0
+ cache_read_input_tokens: 0
+ input_tokens: 100
+ output_tokens: 50
+ type: unknown
+ AnthropicUrlImageSource:
+ example:
+ type: url
+ url: https://example.com/image.jpg
properties:
type:
- type: string
enum:
- - json_schema
- name:
+ - url
type: string
- description:
+ url:
type: string
- strict:
- type: boolean
- nullable: true
- schema:
- type: object
- additionalProperties:
- nullable: true
required:
- type
- - name
- - schema
- description: JSON schema constrained response format
- example:
- type: json_schema
- name: user_info
- description: User information schema
- schema:
- type: object
- properties:
- name:
- type: string
- age:
- type: number
- required:
- - name
- Formats:
- anyOf:
- - $ref: '#/components/schemas/FormatTextConfig'
- - $ref: '#/components/schemas/FormatJsonObjectConfig'
- - $ref: '#/components/schemas/FormatJsonSchemaConfig'
- description: Text response format configuration
- example:
- type: text
- TextConfig:
+ - url
type: object
+ AnthropicUrlPdfSource:
+ example:
+ type: url
+ url: https://example.com/document.pdf
properties:
- format:
- $ref: '#/components/schemas/Formats'
- verbosity:
- type: string
- nullable: true
+ type:
enum:
- - high
- - low
- - medium
- - null
- description: Text output configuration including format and verbosity
+ - url
+ type: string
+ url:
+ type: string
+ required:
+ - type
+ - url
+ type: object
+ AnthropicUsage:
example:
- format:
- type: text
- verbosity: medium
- ServiceTier:
- type: string
- nullable: true
- enum:
- - auto
- - default
- - flex
- - priority
- - scale
- - null
- example: default
- BaseResponsesResult:
+ cache_creation: null
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ inference_geo: null
+ input_tokens: 100
+ output_tokens: 50
+ server_tool_use: null
+ service_tier: standard
+ properties:
+ cache_creation:
+ $ref: '#/components/schemas/AnthropicCacheCreation'
+ cache_creation_input_tokens:
+ type: integer
+ cache_read_input_tokens:
+ type: integer
+ inference_geo:
+ nullable: true
+ type: string
+ input_tokens:
+ type: integer
+ output_tokens:
+ type: integer
+ server_tool_use:
+ $ref: '#/components/schemas/AnthropicServerToolUsage'
+ service_tier:
+ $ref: '#/components/schemas/AnthropicServiceTier'
+ required:
+ - input_tokens
+ - output_tokens
+ - cache_creation_input_tokens
+ - cache_read_input_tokens
+ - cache_creation
+ - inference_geo
+ - server_tool_use
+ - service_tier
type: object
+ AnthropicUsageIteration:
+ anyOf:
+ - $ref: '#/components/schemas/AnthropicCompactionUsageIteration'
+ - $ref: '#/components/schemas/AnthropicMessageUsageIteration'
+ - $ref: '#/components/schemas/AnthropicUnknownUsageIteration'
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: 0
+ cache_read_input_tokens: 0
+ input_tokens: 100
+ output_tokens: 50
+ type: message
+ AnthropicWebFetchBlock:
+ example:
+ content:
+ citations: null
+ source:
+ data: ''
+ media_type: text/plain
+ type: text
+ title: null
+ type: document
+ retrieved_at: null
+ type: web_fetch_result
+ url: https://example.com
properties:
- id:
+ content:
+ $ref: '#/components/schemas/AnthropicDocumentBlock'
+ retrieved_at:
+ nullable: true
type: string
- object:
+ type:
+ enum:
+ - web_fetch_result
+ type: string
+ url:
+ type: string
+ required:
+ - content
+ - retrieved_at
+ - type
+ - url
+ type: object
+ AnthropicWebFetchContent:
+ discriminator:
+ mapping:
+ web_fetch_result: '#/components/schemas/AnthropicWebFetchBlock'
+ web_fetch_tool_result_error: '#/components/schemas/AnthropicWebFetchToolResultError'
+ propertyName: type
+ example:
+ content:
+ citations: null
+ source:
+ data: ''
+ media_type: text/plain
+ type: text
+ title: null
+ type: document
+ retrieved_at: null
+ type: web_fetch_result
+ url: https://example.com
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicWebFetchToolResultError'
+ - $ref: '#/components/schemas/AnthropicWebFetchBlock'
+ AnthropicWebFetchToolResult:
+ example:
+ caller:
+ type: direct
+ content:
+ content:
+ citations: null
+ source:
+ data: ''
+ media_type: text/plain
+ type: text
+ title: null
+ type: document
+ retrieved_at: null
+ type: web_fetch_result
+ url: https://example.com
+ tool_use_id: srvtoolu_01abc
+ type: web_fetch_tool_result
+ properties:
+ caller:
+ $ref: '#/components/schemas/AnthropicCaller'
+ content:
+ $ref: '#/components/schemas/AnthropicWebFetchContent'
+ tool_use_id:
type: string
+ type:
enum:
- - response
- created_at:
- type: integer
- model:
+ - web_fetch_tool_result
type: string
- status:
- $ref: '#/components/schemas/OpenAIResponsesResponseStatus'
- completed_at:
- type: integer
- output:
- type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/OutputMessage'
- - $ref: '#/components/schemas/OutputItemReasoning'
- - $ref: '#/components/schemas/OutputItemFunctionCall'
- - $ref: '#/components/schemas/OutputItemWebSearchCall'
- - $ref: '#/components/schemas/OutputItemFileSearchCall'
- - $ref: '#/components/schemas/OutputItemImageGenerationCall'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OutputMessage'
- reasoning: '#/components/schemas/OutputItemReasoning'
- function_call: '#/components/schemas/OutputItemFunctionCall'
- web_search_call: '#/components/schemas/OutputItemWebSearchCall'
- file_search_call: '#/components/schemas/OutputItemFileSearchCall'
- image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
- user:
+ required:
+ - type
+ - caller
+ - content
+ - tool_use_id
+ type: object
+ AnthropicWebFetchToolResultError:
+ example:
+ error_code: unavailable
+ type: web_fetch_tool_result_error
+ properties:
+ error_code:
+ enum:
+ - invalid_tool_input
+ - url_too_long
+ - url_not_allowed
+ - url_not_accessible
+ - unsupported_content_type
+ - too_many_requests
+ - max_uses_exceeded
+ - unavailable
type: string
- nullable: true
- output_text:
+ type:
+ enum:
+ - web_fetch_tool_result_error
type: string
- prompt_cache_key:
+ required:
+ - type
+ - error_code
+ type: object
+ AnthropicWebSearchResult:
+ example:
+ encrypted_content: enc_content_0
+ page_age: null
+ title: Example Page
+ type: web_search_result
+ url: https://example.com
+ properties:
+ encrypted_content:
type: string
+ page_age:
nullable: true
- safety_identifier:
type: string
+ title:
+ type: string
+ type:
+ enum:
+ - web_search_result
+ type: string
+ url:
+ type: string
+ required:
+ - type
+ - encrypted_content
+ - page_age
+ - title
+ - url
+ type: object
+ AnthropicWebSearchResultBlockParam:
+ example:
+ encrypted_content: enc_content_0
+ title: Example Page
+ type: web_search_result
+ url: https://example.com
+ properties:
+ encrypted_content:
+ type: string
+ page_age:
nullable: true
- error:
- $ref: '#/components/schemas/ResponsesErrorField'
- incomplete_details:
- $ref: '#/components/schemas/IncompleteDetails'
- usage:
- $ref: '#/components/schemas/OpenAIResponsesUsage'
- max_tool_calls:
- type: integer
- top_logprobs:
- type: integer
- max_output_tokens:
- type: integer
- temperature:
- type: number
- format: double
- top_p:
- type: number
- format: double
- presence_penalty:
- type: number
- format: double
- frequency_penalty:
- type: number
- format: double
- instructions:
- $ref: '#/components/schemas/BaseInputs'
- metadata:
- $ref: '#/components/schemas/RequestMetadata'
- tools:
- type: array
- items:
- oneOf:
- - allOf:
- - $ref: '#/components/schemas/FunctionTool'
- - type: object
- properties: {}
- description: Function tool definition
- example:
- type: function
- name: get_weather
- description: Get the current weather in a location
- parameters:
- type: object
- properties:
- location:
- type: string
- description: The city and state
- unit:
- type: string
- enum:
- - celsius
- - fahrenheit
- required:
- - location
- - $ref: '#/components/schemas/Preview_WebSearchServerTool'
- - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool'
- - $ref: '#/components/schemas/Legacy_WebSearchServerTool'
- - $ref: '#/components/schemas/WebSearchServerTool'
- - $ref: '#/components/schemas/FileSearchServerTool'
- - $ref: '#/components/schemas/ComputerUseServerTool'
- - $ref: '#/components/schemas/CodeInterpreterServerTool'
- - $ref: '#/components/schemas/McpServerTool'
- - $ref: '#/components/schemas/ImageGenerationServerTool'
- - $ref: '#/components/schemas/CodexLocalShellTool'
- - $ref: '#/components/schemas/ShellServerTool'
- - $ref: '#/components/schemas/ApplyPatchServerTool'
- - $ref: '#/components/schemas/CustomTool'
- tool_choice:
- $ref: '#/components/schemas/OpenAIResponsesToolChoice'
- parallel_tool_calls:
- type: boolean
- prompt:
- $ref: '#/components/schemas/StoredPromptTemplate'
- background:
- type: boolean
- nullable: true
- previous_response_id:
type: string
- nullable: true
- reasoning:
- $ref: '#/components/schemas/BaseReasoningConfig'
- service_tier:
- $ref: '#/components/schemas/ServiceTier'
- store:
- type: boolean
- truncation:
- $ref: '#/components/schemas/Truncation'
- text:
- $ref: '#/components/schemas/TextConfig'
+ title:
+ type: string
+ type:
+ enum:
+ - web_search_result
+ type: string
+ url:
+ type: string
required:
- - id
- - object
- - created_at
- - model
- - status
- - completed_at
- - output
- - error
- - incomplete_details
- - temperature
- - top_p
- - presence_penalty
- - frequency_penalty
- - instructions
- - metadata
- - tools
- - tool_choice
- - parallel_tool_calls
+ - type
+ - encrypted_content
+ - title
+ - url
+ type: object
+ AnthropicWebSearchToolResult:
example:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: completed
- completed_at: 1704067210
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- OpenResponsesResult:
- allOf:
- - $ref: '#/components/schemas/BaseResponsesResult'
- - type: object
- properties:
- output:
+ caller:
+ type: direct
+ content: []
+ tool_use_id: srvtoolu_01abc
+ type: web_search_tool_result
+ properties:
+ caller:
+ $ref: '#/components/schemas/AnthropicCaller'
+ content:
+ anyOf:
+ - items:
+ $ref: '#/components/schemas/AnthropicWebSearchResult'
type: array
- items:
- $ref: '#/components/schemas/OutputItems'
- usage:
- $ref: '#/components/schemas/Usage'
- service_tier:
- type: string
- nullable: true
+ - $ref: '#/components/schemas/AnthropicWebSearchToolResultError'
+ tool_use_id:
+ type: string
+ type:
+ enum:
+ - web_search_tool_result
+ type: string
+ required:
+ - type
+ - caller
+ - tool_use_id
+ - content
+ type: object
+ AnthropicWebSearchToolResultError:
example:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: completed
- output:
- - type: message
- id: msg-abc123
- status: completed
- role: assistant
- content:
- - type: output_text
- text: Hello! How can I help you today?
- annotations: []
- usage:
- input_tokens: 10
- output_tokens: 25
- total_tokens: 35
- input_tokens_details:
- cached_tokens: 0
- output_tokens_details:
- reasoning_tokens: 0
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- temperature: null
- top_p: null
- max_output_tokens: null
- metadata: null
- instructions: null
- description: Complete non-streaming response from the Responses API
- CreatedEvent:
+ error_code: unavailable
+ type: web_search_tool_result_error
+ properties:
+ error_code:
+ enum:
+ - invalid_tool_input
+ - unavailable
+ - max_uses_exceeded
+ - too_many_requests
+ - query_too_long
+ - request_too_large
+ type: string
+ type:
+ enum:
+ - web_search_tool_result_error
+ type: string
+ required:
+ - type
+ - error_code
type: object
+ AnthropicWebSearchToolUserLocation:
+ example:
+ city: San Francisco
+ country: US
+ region: California
+ timezone: America/Los_Angeles
+ type: approximate
+ nullable: true
properties:
+ city:
+ nullable: true
+ type: string
+ country:
+ nullable: true
+ type: string
+ region:
+ nullable: true
+ type: string
+ timezone:
+ nullable: true
+ type: string
type:
+ enum:
+ - approximate
type: string
+ required:
+ - type
+ type: object
+ ApplyPatchServerTool:
+ description: Apply patch tool configuration
+ example:
+ type: apply_patch
+ properties:
+ type:
enum:
- - response.created
- response:
- $ref: '#/components/schemas/BaseResponsesResult'
- sequence_number:
- type: integer
+ - apply_patch
+ type: string
required:
- type
- - response
- - sequence_number
- description: Event emitted when a response is created
+ type: object
+ AutoRouterPlugin:
example:
- type: response.created
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: in_progress
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 0
- OpenResponsesCreatedEvent:
- allOf:
- - $ref: '#/components/schemas/CreatedEvent'
- - type: object
- properties:
- response:
- $ref: '#/components/schemas/OpenResponsesResult'
- description: Event emitted when a response is created
- example:
- type: response.created
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: in_progress
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 0
- InProgressEvent:
+ allowed_models:
+ - anthropic/*
+ - openai/gpt-4o
+ enabled: true
+ id: auto-router
+ properties:
+ allowed_models:
+ description: >-
+ List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g.,
+ "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list.
+ example:
+ - anthropic/*
+ - openai/gpt-4o
+ - google/*
+ items:
+ type: string
+ type: array
+ enabled:
+ description: Set to false to disable the auto-router plugin for this request. Defaults to true.
+ type: boolean
+ id:
+ enum:
+ - auto-router
+ type: string
+ required:
+ - id
type: object
+ BadGatewayResponse:
+ description: Bad Gateway - Provider/upstream API failure
+ example:
+ error:
+ code: 502
+ message: Provider returned error
properties:
- type:
+ error:
+ $ref: '#/components/schemas/BadGatewayResponseErrorData'
+ user_id:
+ nullable: true
type: string
- enum:
- - response.in_progress
- response:
- $ref: '#/components/schemas/BaseResponsesResult'
- sequence_number:
+ required:
+ - error
+ type: object
+ BadGatewayResponseErrorData:
+ description: Error data for BadGatewayResponse
+ example:
+ code: 502
+ message: Provider returned error
+ properties:
+ code:
type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
required:
- - type
- - response
- - sequence_number
- description: Event emitted when a response is in progress
+ - code
+ - message
+ type: object
+ BadRequestResponse:
+ description: Bad Request - Invalid request parameters or malformed input
example:
- type: response.in_progress
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: in_progress
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 1
- OpenResponsesInProgressEvent:
- allOf:
- - $ref: '#/components/schemas/InProgressEvent'
- - type: object
- properties:
- response:
- $ref: '#/components/schemas/OpenResponsesResult'
- description: Event emitted when a response is in progress
+ error:
+ code: 400
+ message: Invalid request parameters
+ properties:
+ error:
+ $ref: '#/components/schemas/BadRequestResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ BadRequestResponseErrorData:
+ description: Error data for BadRequestResponse
example:
- type: response.in_progress
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: in_progress
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 1
- CompletedEvent:
+ code: 400
+ message: Invalid request parameters
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
type: object
+ BaseAnnotationAddedEvent:
+ description: Event emitted when a text annotation is added to output
+ example:
+ annotation:
+ end_index: 7
+ start_index: 0
+ title: Example
+ type: url_citation
+ url: https://example.com
+ annotation_index: 0
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ sequence_number: 5
+ type: response.output_text.annotation.added
properties:
- type:
+ annotation:
+ $ref: '#/components/schemas/OpenAIResponsesAnnotation'
+ annotation_index:
+ type: integer
+ content_index:
+ type: integer
+ item_id:
type: string
- enum:
- - response.completed
- response:
- $ref: '#/components/schemas/BaseResponsesResult'
+ output_index:
+ type: integer
sequence_number:
type: integer
+ type:
+ enum:
+ - response.output_text.annotation.added
+ type: string
required:
- type
- - response
+ - output_index
+ - item_id
+ - content_index
- sequence_number
- description: Event emitted when a response has completed successfully
+ - annotation_index
+ - annotation
+ type: object
+ BaseContentPartAddedEvent:
+ description: Event emitted when a new content part is added to an output item
example:
- type: response.completed
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: completed
- output:
- - id: item-1
- type: message
- status: completed
- role: assistant
- content:
- - type: output_text
- text: Hello! How can I help you?
- annotations: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 10
- StreamEventsResponseCompleted:
- allOf:
- - $ref: '#/components/schemas/CompletedEvent'
- - type: object
- properties:
- response:
- $ref: '#/components/schemas/OpenResponsesResult'
- description: Event emitted when a response has completed successfully
- example:
- type: response.completed
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: completed
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 10
- IncompleteEvent:
- type: object
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ part:
+ annotations: []
+ text: ''
+ type: output_text
+ sequence_number: 3
+ type: response.content_part.added
properties:
- type:
+ content_index:
+ type: integer
+ item_id:
type: string
- enum:
- - response.incomplete
- response:
- $ref: '#/components/schemas/BaseResponsesResult'
+ output_index:
+ type: integer
+ part:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
sequence_number:
type: integer
+ type:
+ enum:
+ - response.content_part.added
+ type: string
required:
- type
- - response
+ - output_index
+ - item_id
+ - content_index
+ - part
- sequence_number
- description: Event emitted when a response is incomplete
- example:
- type: response.incomplete
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: incomplete
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 5
- StreamEventsResponseIncomplete:
- allOf:
- - $ref: '#/components/schemas/IncompleteEvent'
- - type: object
- properties:
- response:
- $ref: '#/components/schemas/OpenResponsesResult'
- description: Event emitted when a response is incomplete
- example:
- type: response.incomplete
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: incomplete
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 5
- FailedEvent:
type: object
+ BaseContentPartDoneEvent:
+ description: Event emitted when a content part is complete
+ example:
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ part:
+ annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ sequence_number: 7
+ type: response.content_part.done
properties:
- type:
+ content_index:
+ type: integer
+ item_id:
type: string
- enum:
- - response.failed
- response:
- $ref: '#/components/schemas/BaseResponsesResult'
+ output_index:
+ type: integer
+ part:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
sequence_number:
type: integer
+ type:
+ enum:
+ - response.content_part.done
+ type: string
required:
- type
- - response
+ - output_index
+ - item_id
+ - content_index
+ - part
- sequence_number
- description: Event emitted when a response has failed
- example:
- type: response.failed
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: failed
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 3
- StreamEventsResponseFailed:
- allOf:
- - $ref: '#/components/schemas/FailedEvent'
- - type: object
- properties:
- response:
- $ref: '#/components/schemas/OpenResponsesResult'
- description: Event emitted when a response has failed
- example:
- type: response.failed
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: failed
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 3
- BaseErrorEvent:
type: object
+ BaseErrorEvent:
+ description: Event emitted when an error occurs during streaming
+ example:
+ code: rate_limit_exceeded
+ message: Rate limit exceeded. Please try again later.
+ param: null
+ sequence_number: 2
+ type: error
properties:
- type:
- type: string
- enum:
- - error
code:
- type: string
nullable: true
+ type: string
message:
type: string
param:
- type: string
nullable: true
+ type: string
sequence_number:
type: integer
+ type:
+ enum:
+ - error
+ type: string
required:
- type
- code
- message
- param
- sequence_number
- description: Event emitted when an error occurs during streaming
- example:
- type: error
- code: rate_limit_exceeded
- message: Rate limit exceeded. Please try again later.
- param: null
- sequence_number: 2
- ErrorEvent:
- allOf:
- - $ref: '#/components/schemas/BaseErrorEvent'
- - type: object
- properties: {}
- description: Event emitted when an error occurs during streaming
- example:
- type: error
- code: rate_limit_exceeded
- message: Rate limit exceeded. Please try again later.
- param: null
- sequence_number: 2
- OutputItemAddedEvent:
type: object
+ BaseFunctionCallArgsDeltaEvent:
+ description: Event emitted when function call arguments are being streamed
+ example:
+ delta: '{"city": "..."}'
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ type: response.function_call_arguments.delta
properties:
- type:
+ delta:
+ type: string
+ item_id:
type: string
- enum:
- - response.output_item.added
output_index:
type: integer
- item:
- oneOf:
- - $ref: '#/components/schemas/OutputMessage'
- - $ref: '#/components/schemas/OutputItemReasoning'
- - $ref: '#/components/schemas/OutputItemFunctionCall'
- - $ref: '#/components/schemas/OutputItemWebSearchCall'
- - $ref: '#/components/schemas/OutputItemFileSearchCall'
- - $ref: '#/components/schemas/OutputItemImageGenerationCall'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OutputMessage'
- reasoning: '#/components/schemas/OutputItemReasoning'
- function_call: '#/components/schemas/OutputItemFunctionCall'
- web_search_call: '#/components/schemas/OutputItemWebSearchCall'
- file_search_call: '#/components/schemas/OutputItemFileSearchCall'
- image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
sequence_number:
type: integer
- required:
- - type
- - output_index
- - item
- - sequence_number
- description: Event emitted when a new output item is added to the response
- example:
- type: response.output_item.added
- output_index: 0
- item:
- id: item-1
- type: message
- status: in_progress
- role: assistant
- content: []
- sequence_number: 2
- StreamEventsResponseOutputItemAdded:
- allOf:
- - $ref: '#/components/schemas/OutputItemAddedEvent'
- - type: object
- properties:
- item:
- $ref: '#/components/schemas/OutputItems'
- description: Event emitted when a new output item is added to the response
- example:
- type: response.output_item.added
- output_index: 0
- item:
- id: item-1
- type: message
- status: in_progress
- role: assistant
- content: []
- sequence_number: 2
- OutputItemDoneEvent:
- type: object
- properties:
type:
- type: string
enum:
- - response.output_item.done
- output_index:
- type: integer
- item:
- oneOf:
- - $ref: '#/components/schemas/OutputMessage'
- - $ref: '#/components/schemas/OutputItemReasoning'
- - $ref: '#/components/schemas/OutputItemFunctionCall'
- - $ref: '#/components/schemas/OutputItemWebSearchCall'
- - $ref: '#/components/schemas/OutputItemFileSearchCall'
- - $ref: '#/components/schemas/OutputItemImageGenerationCall'
- discriminator:
- propertyName: type
- mapping:
- message: '#/components/schemas/OutputMessage'
- reasoning: '#/components/schemas/OutputItemReasoning'
- function_call: '#/components/schemas/OutputItemFunctionCall'
- web_search_call: '#/components/schemas/OutputItemWebSearchCall'
- file_search_call: '#/components/schemas/OutputItemFileSearchCall'
- image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
- sequence_number:
- type: integer
+ - response.function_call_arguments.delta
+ type: string
required:
- type
+ - item_id
- output_index
- - item
+ - delta
- sequence_number
- description: Event emitted when an output item is complete
- example:
- type: response.output_item.done
- output_index: 0
- item:
- id: item-1
- type: message
- status: completed
- role: assistant
- content:
- - type: output_text
- text: Hello! How can I help you?
- annotations: []
- sequence_number: 8
- StreamEventsResponseOutputItemDone:
- allOf:
- - $ref: '#/components/schemas/OutputItemDoneEvent'
- - type: object
- properties:
- item:
- $ref: '#/components/schemas/OutputItems'
- description: Event emitted when an output item is complete
+ type: object
+ BaseFunctionCallArgsDoneEvent:
+ description: Event emitted when function call arguments streaming is complete
example:
- type: response.output_item.done
+ arguments: '{"city": "San Francisco", "units": "celsius"}'
+ item_id: item-1
+ name: get_weather
output_index: 0
- item:
- id: item-1
- type: message
- status: completed
- role: assistant
- content:
- - type: output_text
- text: Hello! How can I help you?
- annotations: []
- sequence_number: 8
- BaseContentPartAddedEvent:
- type: object
+ sequence_number: 6
+ type: response.function_call_arguments.done
properties:
- type:
+ arguments:
type: string
- enum:
- - response.content_part.added
- output_index:
- type: integer
item_id:
type: string
- content_index:
+ name:
+ type: string
+ output_index:
type: integer
- part:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
sequence_number:
type: integer
+ type:
+ enum:
+ - response.function_call_arguments.done
+ type: string
required:
- type
- - output_index
- item_id
- - content_index
- - part
+ - output_index
+ - name
+ - arguments
- sequence_number
- description: Event emitted when a new content part is added to an output item
+ type: object
+ BaseInputs:
+ anyOf:
+ - type: string
+ - items:
+ anyOf:
+ - properties:
+ content:
+ anyOf:
+ - items:
+ discriminator:
+ mapping:
+ input_audio: '#/components/schemas/InputAudio'
+ input_file: '#/components/schemas/InputFile'
+ input_image: '#/components/schemas/InputImage'
+ input_text: '#/components/schemas/InputText'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - $ref: '#/components/schemas/InputImage'
+ - $ref: '#/components/schemas/InputFile'
+ - $ref: '#/components/schemas/InputAudio'
+ type: array
+ - type: string
+ phase:
+ anyOf:
+ - enum:
+ - commentary
+ type: string
+ - enum:
+ - final_answer
+ type: string
+ - nullable: true
+ role:
+ anyOf:
+ - enum:
+ - user
+ type: string
+ - enum:
+ - system
+ type: string
+ - enum:
+ - assistant
+ type: string
+ - enum:
+ - developer
+ type: string
+ type:
+ enum:
+ - message
+ type: string
+ required:
+ - role
+ - content
+ type: object
+ - $ref: '#/components/schemas/OpenAIResponseInputMessageItem'
+ - $ref: '#/components/schemas/OpenAIResponseFunctionToolCallOutput'
+ - $ref: '#/components/schemas/OpenAIResponseFunctionToolCall'
+ - $ref: '#/components/schemas/OutputItemImageGenerationCall'
+ - $ref: '#/components/schemas/OutputMessage'
+ type: array
+ - nullable: true
example:
- type: response.content_part.added
- output_index: 0
- item_id: item-1
- content_index: 0
- part:
- type: output_text
- text: ''
- annotations: []
- sequence_number: 3
- ContentPartAddedEvent:
- allOf:
- - $ref: '#/components/schemas/BaseContentPartAddedEvent'
- - type: object
- properties:
- part:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/ReasoningTextContent'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
- description: Event emitted when a new content part is added to an output item
+ - content: What is the weather today?
+ role: user
+ BaseMessagesResult:
+ description: Base Anthropic Messages API response before OpenRouter extensions
example:
- type: response.content_part.added
- output_index: 0
- item_id: item-1
- content_index: 0
- part:
- type: output_text
- text: ''
- annotations: []
- sequence_number: 3
- BaseContentPartDoneEvent:
- type: object
+ container: null
+ content:
+ - citations: null
+ text: Hello!
+ type: text
+ id: msg_01XFDUDYJgAACzvnptvVoYEL
+ model: claude-sonnet-4-5-20250929
+ role: assistant
+ stop_reason: end_turn
+ stop_sequence: null
+ type: message
+ usage:
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ input_tokens: 12
+ output_tokens: 8
properties:
- type:
+ container:
+ $ref: '#/components/schemas/AnthropicContainer'
+ content:
+ items:
+ $ref: '#/components/schemas/ORAnthropicContentBlock'
+ type: array
+ id:
type: string
+ model:
+ type: string
+ role:
enum:
- - response.content_part.done
- output_index:
- type: integer
- item_id:
+ - assistant
type: string
- content_index:
- type: integer
- part:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
- sequence_number:
- type: integer
+ stop_reason:
+ $ref: '#/components/schemas/ORAnthropicStopReason'
+ stop_sequence:
+ nullable: true
+ type: string
+ type:
+ enum:
+ - message
+ type: string
+ usage:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicUsage'
+ - properties:
+ iterations:
+ items:
+ $ref: '#/components/schemas/AnthropicUsageIteration'
+ type: array
+ speed:
+ $ref: '#/components/schemas/AnthropicSpeed'
+ type: object
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ inference_geo: null
+ input_tokens: 100
+ output_tokens: 50
+ server_tool_use: null
+ service_tier: standard
required:
+ - id
- type
- - output_index
- - item_id
- - content_index
- - part
- - sequence_number
- description: Event emitted when a content part is complete
- example:
- type: response.content_part.done
- output_index: 0
- item_id: item-1
- content_index: 0
- part:
- type: output_text
- text: Hello! How can I help you?
- annotations: []
- sequence_number: 7
- ContentPartDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseContentPartDoneEvent'
- - type: object
- properties:
- part:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/ReasoningTextContent'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
- description: Event emitted when a content part is complete
- example:
- type: response.content_part.done
- output_index: 0
- item_id: item-1
- content_index: 0
- part:
- type: output_text
- text: Hello! How can I help you?
- annotations: []
- sequence_number: 7
- OpenResponsesTopLogprobs:
+ - role
+ - container
+ - content
+ - model
+ - stop_reason
+ - stop_sequence
+ - usage
type: object
- properties:
- token:
- type: string
- logprob:
- type: number
- format: double
- bytes:
- type: array
- items:
- type: integer
- description: Alternative token with its log probability
- example:
- token: hello
- logprob: -0.5
- StreamLogprobTopLogprob:
- allOf:
- - $ref: '#/components/schemas/OpenResponsesTopLogprobs'
- - type: object
- properties: {}
- description: Alternative token with its log probability
+ BaseReasoningConfig:
example:
- token: Hello
- logprob: -0.5
- bytes:
- - 72
- - 101
- - 108
- - 108
- - 111
- OpenResponsesLogProbs:
- type: object
+ effort: medium
+ summary: auto
+ nullable: true
properties:
- logprob:
- type: number
- format: double
- token:
- type: string
- top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenResponsesTopLogprobs'
- bytes:
- type: array
- items:
- type: integer
- required:
- - logprob
- - token
- description: Log probability information for a token
- example:
- logprob: -0.1
- token: world
- top_logprobs:
- - token: hello
- logprob: -0.5
- StreamLogprob:
- allOf:
- - $ref: '#/components/schemas/OpenResponsesLogProbs'
- - type: object
- properties:
- top_logprobs:
- type: array
- items:
- $ref: '#/components/schemas/StreamLogprobTopLogprob'
- description: Log probability information for a token
- example:
- token: Hello
- logprob: -0.5
- bytes:
- - 72
- - 101
- - 108
- - 108
- - 111
- top_logprobs: []
- BaseTextDeltaEvent:
+ effort:
+ $ref: '#/components/schemas/ReasoningEffort'
+ summary:
+ $ref: '#/components/schemas/ReasoningSummaryVerbosity'
type: object
+ BaseReasoningDeltaEvent:
+ description: Event emitted when reasoning text delta is streamed
+ example:
+ content_index: 0
+ delta: First, we need
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ type: response.reasoning_text.delta
properties:
- type:
- type: string
- enum:
- - response.output_text.delta
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenResponsesLogProbs'
- output_index:
- type: integer
- item_id:
- type: string
content_index:
type: integer
delta:
type: string
+ item_id:
+ type: string
+ output_index:
+ type: integer
sequence_number:
type: integer
+ type:
+ enum:
+ - response.reasoning_text.delta
+ type: string
required:
- type
- - logprobs
- output_index
- item_id
- content_index
- delta
- sequence_number
- description: Event emitted when a text delta is streamed
+ type: object
+ BaseReasoningDoneEvent:
+ description: Event emitted when reasoning text streaming is complete
example:
- type: response.output_text.delta
- logprobs: []
- output_index: 0
- item_id: item-1
content_index: 0
- delta: Hello
- sequence_number: 4
- TextDeltaEvent:
- allOf:
- - $ref: '#/components/schemas/BaseTextDeltaEvent'
- - type: object
- properties:
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/StreamLogprob'
- description: Event emitted when a text delta is streamed
- example:
- type: response.output_text.delta
- logprobs: []
- output_index: 0
item_id: item-1
- content_index: 0
- delta: Hello
- sequence_number: 4
- BaseTextDoneEvent:
- type: object
+ output_index: 0
+ sequence_number: 6
+ text: First, we need to identify the key components and then combine them logically.
+ type: response.reasoning_text.done
properties:
- type:
- type: string
- enum:
- - response.output_text.done
- output_index:
+ content_index:
type: integer
item_id:
type: string
- content_index:
+ output_index:
type: integer
- text:
- type: string
sequence_number:
type: integer
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/OpenResponsesLogProbs'
+ text:
+ type: string
+ type:
+ enum:
+ - response.reasoning_text.done
+ type: string
required:
- type
- output_index
@@ -2949,7712 +2452,6740 @@ components:
- content_index
- text
- sequence_number
- - logprobs
- description: Event emitted when text streaming is complete
+ type: object
+ BaseReasoningSummaryPartAddedEvent:
+ description: Event emitted when a reasoning summary part is added
example:
- type: response.output_text.done
- output_index: 0
item_id: item-1
- content_index: 0
- text: Hello! How can I help you?
- sequence_number: 6
- logprobs: []
- TextDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseTextDoneEvent'
- - type: object
- properties:
- logprobs:
- type: array
- items:
- $ref: '#/components/schemas/StreamLogprob'
- description: Event emitted when text streaming is complete
- example:
- type: response.output_text.done
output_index: 0
- item_id: item-1
- content_index: 0
- text: Hello! How can I help you?
- sequence_number: 6
- logprobs: []
- BaseRefusalDeltaEvent:
- type: object
+ part:
+ text: ''
+ type: summary_text
+ sequence_number: 3
+ summary_index: 0
+ type: response.reasoning_summary_part.added
properties:
- type:
- type: string
- enum:
- - response.refusal.delta
- output_index:
- type: integer
item_id:
type: string
- content_index:
+ output_index:
type: integer
- delta:
- type: string
+ part:
+ $ref: '#/components/schemas/ReasoningSummaryText'
sequence_number:
type: integer
+ summary_index:
+ type: integer
+ type:
+ enum:
+ - response.reasoning_summary_part.added
+ type: string
required:
- type
- output_index
- item_id
- - content_index
- - delta
+ - summary_index
+ - part
- sequence_number
- description: Event emitted when a refusal delta is streamed
+ type: object
+ BaseReasoningSummaryPartDoneEvent:
+ description: Event emitted when a reasoning summary part is complete
example:
- type: response.refusal.delta
- output_index: 0
item_id: item-1
- content_index: 0
- delta: I'm sorry
- sequence_number: 4
- RefusalDeltaEvent:
- allOf:
- - $ref: '#/components/schemas/BaseRefusalDeltaEvent'
- - type: object
- properties: {}
- description: Event emitted when a refusal delta is streamed
- example:
- type: response.refusal.delta
output_index: 0
- item_id: item-1
- content_index: 0
- delta: I'm sorry
- sequence_number: 4
- BaseRefusalDoneEvent:
- type: object
+ part:
+ text: Analyzing the problem step by step to find the optimal solution.
+ type: summary_text
+ sequence_number: 7
+ summary_index: 0
+ type: response.reasoning_summary_part.done
properties:
- type:
- type: string
- enum:
- - response.refusal.done
- output_index:
- type: integer
item_id:
type: string
- content_index:
+ output_index:
type: integer
- refusal:
- type: string
+ part:
+ $ref: '#/components/schemas/ReasoningSummaryText'
sequence_number:
type: integer
+ summary_index:
+ type: integer
+ type:
+ enum:
+ - response.reasoning_summary_part.done
+ type: string
required:
- type
- output_index
- item_id
- - content_index
- - refusal
+ - summary_index
+ - part
- sequence_number
- description: Event emitted when refusal streaming is complete
+ type: object
+ BaseReasoningSummaryTextDeltaEvent:
+ description: Event emitted when reasoning summary text delta is streamed
example:
- type: response.refusal.done
- output_index: 0
+ delta: Analyzing
item_id: item-1
- content_index: 0
- refusal: I'm sorry, but I can't assist with that request.
- sequence_number: 6
- RefusalDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseRefusalDoneEvent'
- - type: object
- properties: {}
- description: Event emitted when refusal streaming is complete
- example:
- type: response.refusal.done
output_index: 0
- item_id: item-1
- content_index: 0
- refusal: I'm sorry, but I can't assist with that request.
- sequence_number: 6
- BaseAnnotationAddedEvent:
- type: object
+ sequence_number: 4
+ summary_index: 0
+ type: response.reasoning_summary_text.delta
properties:
- type:
+ delta:
type: string
- enum:
- - response.output_text.annotation.added
- output_index:
- type: integer
item_id:
type: string
- content_index:
+ output_index:
type: integer
sequence_number:
type: integer
- annotation_index:
+ summary_index:
type: integer
- annotation:
- $ref: '#/components/schemas/OpenAIResponsesAnnotation'
+ type:
+ enum:
+ - response.reasoning_summary_text.delta
+ type: string
required:
- type
- - output_index
- item_id
- - content_index
+ - output_index
+ - summary_index
+ - delta
- sequence_number
- - annotation_index
- - annotation
- description: Event emitted when a text annotation is added to output
+ type: object
+ BaseReasoningSummaryTextDoneEvent:
+ description: Event emitted when reasoning summary text streaming is complete
example:
- type: response.output_text.annotation.added
- output_index: 0
item_id: item-1
- content_index: 0
- sequence_number: 5
- annotation_index: 0
- annotation:
- type: url_citation
- url: https://example.com
- title: Example
- start_index: 0
- end_index: 7
- AnnotationAddedEvent:
- allOf:
- - $ref: '#/components/schemas/BaseAnnotationAddedEvent'
- - type: object
- properties: {}
- description: Event emitted when a text annotation is added to output
- example:
- type: response.output_text.annotation.added
output_index: 0
- item_id: item-1
- content_index: 0
- sequence_number: 5
- annotation_index: 0
- annotation:
- type: url_citation
- url: https://example.com
- title: Example
- start_index: 0
- end_index: 7
- BaseFunctionCallArgsDeltaEvent:
- type: object
+ sequence_number: 6
+ summary_index: 0
+ text: Analyzing the problem step by step to find the optimal solution.
+ type: response.reasoning_summary_text.done
properties:
- type:
- type: string
- enum:
- - response.function_call_arguments.delta
item_id:
type: string
output_index:
type: integer
- delta:
- type: string
sequence_number:
type: integer
+ summary_index:
+ type: integer
+ text:
+ type: string
+ type:
+ enum:
+ - response.reasoning_summary_text.done
+ type: string
required:
- type
- item_id
- output_index
- - delta
+ - summary_index
+ - text
- sequence_number
- description: Event emitted when function call arguments are being streamed
- example:
- type: response.function_call_arguments.delta
- item_id: item-1
- output_index: 0
- delta: '{"city": "..."}'
- sequence_number: 4
- FunctionCallArgsDeltaEvent:
- allOf:
- - $ref: '#/components/schemas/BaseFunctionCallArgsDeltaEvent'
- - type: object
- properties: {}
- description: Event emitted when function call arguments are being streamed
+ type: object
+ BaseRefusalDeltaEvent:
+ description: Event emitted when a refusal delta is streamed
example:
- type: response.function_call_arguments.delta
+ content_index: 0
+ delta: I'm sorry
item_id: item-1
output_index: 0
- delta: '{"city": "..."}'
sequence_number: 4
- BaseFunctionCallArgsDoneEvent:
- type: object
+ type: response.refusal.delta
properties:
- type:
+ content_index:
+ type: integer
+ delta:
type: string
- enum:
- - response.function_call_arguments.done
item_id:
type: string
output_index:
type: integer
- name:
- type: string
- arguments:
- type: string
sequence_number:
type: integer
+ type:
+ enum:
+ - response.refusal.delta
+ type: string
required:
- type
- - item_id
- output_index
- - name
- - arguments
+ - item_id
+ - content_index
+ - delta
- sequence_number
- description: Event emitted when function call arguments streaming is complete
- example:
- type: response.function_call_arguments.done
- item_id: item-1
- output_index: 0
- name: get_weather
- arguments: '{"city": "San Francisco", "units": "celsius"}'
- sequence_number: 6
- FunctionCallArgsDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseFunctionCallArgsDoneEvent'
- - type: object
- properties: {}
- description: Event emitted when function call arguments streaming is complete
+ type: object
+ BaseRefusalDoneEvent:
+ description: Event emitted when refusal streaming is complete
example:
- type: response.function_call_arguments.done
+ content_index: 0
item_id: item-1
output_index: 0
- name: get_weather
- arguments: '{"city": "San Francisco", "units": "celsius"}'
+ refusal: I'm sorry, but I can't assist with that request.
sequence_number: 6
- BaseReasoningDeltaEvent:
- type: object
+ type: response.refusal.done
properties:
- type:
- type: string
- enum:
- - response.reasoning_text.delta
- output_index:
+ content_index:
type: integer
item_id:
type: string
- content_index:
+ output_index:
type: integer
- delta:
+ refusal:
type: string
sequence_number:
type: integer
+ type:
+ enum:
+ - response.refusal.done
+ type: string
required:
- type
- output_index
- item_id
- content_index
- - delta
+ - refusal
- sequence_number
- description: Event emitted when reasoning text delta is streamed
- example:
- type: response.reasoning_text.delta
- output_index: 0
- item_id: item-1
- content_index: 0
- delta: First, we need
- sequence_number: 4
- ReasoningDeltaEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningDeltaEvent'
- - type: object
- properties: {}
- description: Event emitted when reasoning text delta is streamed
- example:
- type: response.reasoning_text.delta
- output_index: 0
- item_id: item-1
- content_index: 0
- delta: First, we need
- sequence_number: 4
- BaseReasoningDoneEvent:
type: object
+ BaseResponsesResult:
+ example:
+ completed_at: 1704067210
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: completed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
properties:
- type:
+ background:
+ nullable: true
+ type: boolean
+ completed_at:
+ type: integer
+ created_at:
+ type: integer
+ error:
+ $ref: '#/components/schemas/ResponsesErrorField'
+ frequency_penalty:
+ format: double
+ type: number
+ id:
+ type: string
+ incomplete_details:
+ $ref: '#/components/schemas/IncompleteDetails'
+ instructions:
+ $ref: '#/components/schemas/BaseInputs'
+ max_output_tokens:
+ type: integer
+ max_tool_calls:
+ type: integer
+ metadata:
+ $ref: '#/components/schemas/RequestMetadata'
+ model:
type: string
+ object:
enum:
- - response.reasoning_text.done
- output_index:
+ - response
+ type: string
+ output:
+ items:
+ discriminator:
+ mapping:
+ file_search_call: '#/components/schemas/OutputItemFileSearchCall'
+ function_call: '#/components/schemas/OutputItemFunctionCall'
+ image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
+ message: '#/components/schemas/OutputMessage'
+ reasoning: '#/components/schemas/OutputItemReasoning'
+ web_search_call: '#/components/schemas/OutputItemWebSearchCall'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/OutputMessage'
+ - $ref: '#/components/schemas/OutputItemReasoning'
+ - $ref: '#/components/schemas/OutputItemFunctionCall'
+ - $ref: '#/components/schemas/OutputItemWebSearchCall'
+ - $ref: '#/components/schemas/OutputItemFileSearchCall'
+ - $ref: '#/components/schemas/OutputItemImageGenerationCall'
+ type: array
+ output_text:
+ type: string
+ parallel_tool_calls:
+ type: boolean
+ presence_penalty:
+ format: double
+ type: number
+ previous_response_id:
+ nullable: true
+ type: string
+ prompt:
+ $ref: '#/components/schemas/StoredPromptTemplate'
+ prompt_cache_key:
+ nullable: true
+ type: string
+ reasoning:
+ $ref: '#/components/schemas/BaseReasoningConfig'
+ safety_identifier:
+ nullable: true
+ type: string
+ service_tier:
+ $ref: '#/components/schemas/ServiceTier'
+ status:
+ $ref: '#/components/schemas/OpenAIResponsesResponseStatus'
+ store:
+ type: boolean
+ temperature:
+ format: double
+ type: number
+ text:
+ $ref: '#/components/schemas/TextConfig'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAIResponsesToolChoice'
+ tools:
+ items:
+ oneOf:
+ - allOf:
+ - $ref: '#/components/schemas/FunctionTool'
+ - properties: {}
+ type: object
+ description: Function tool definition
+ example:
+ description: Get the current weather in a location
+ name: get_weather
+ parameters:
+ properties:
+ location:
+ description: The city and state
+ type: string
+ unit:
+ enum:
+ - celsius
+ - fahrenheit
+ type: string
+ required:
+ - location
+ type: object
+ type: function
+ - $ref: '#/components/schemas/Preview_WebSearchServerTool'
+ - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool'
+ - $ref: '#/components/schemas/Legacy_WebSearchServerTool'
+ - $ref: '#/components/schemas/WebSearchServerTool'
+ - $ref: '#/components/schemas/FileSearchServerTool'
+ - $ref: '#/components/schemas/ComputerUseServerTool'
+ - $ref: '#/components/schemas/CodeInterpreterServerTool'
+ - $ref: '#/components/schemas/McpServerTool'
+ - $ref: '#/components/schemas/ImageGenerationServerTool'
+ - $ref: '#/components/schemas/CodexLocalShellTool'
+ - $ref: '#/components/schemas/ShellServerTool'
+ - $ref: '#/components/schemas/ApplyPatchServerTool'
+ - $ref: '#/components/schemas/CustomTool'
+ type: array
+ top_logprobs:
type: integer
- item_id:
+ top_p:
+ format: double
+ type: number
+ truncation:
+ $ref: '#/components/schemas/Truncation'
+ usage:
+ $ref: '#/components/schemas/OpenAIResponsesUsage'
+ user:
+ nullable: true
type: string
+ required:
+ - id
+ - object
+ - created_at
+ - model
+ - status
+ - completed_at
+ - output
+ - error
+ - incomplete_details
+ - temperature
+ - top_p
+ - presence_penalty
+ - frequency_penalty
+ - instructions
+ - metadata
+ - tools
+ - tool_choice
+ - parallel_tool_calls
+ type: object
+ BaseTextDeltaEvent:
+ description: Event emitted when a text delta is streamed
+ example:
+ content_index: 0
+ delta: Hello
+ item_id: item-1
+ logprobs: []
+ output_index: 0
+ sequence_number: 4
+ type: response.output_text.delta
+ properties:
content_index:
type: integer
- text:
+ delta:
+ type: string
+ item_id:
type: string
+ logprobs:
+ items:
+ $ref: '#/components/schemas/OpenResponsesLogProbs'
+ type: array
+ output_index:
+ type: integer
sequence_number:
type: integer
+ type:
+ enum:
+ - response.output_text.delta
+ type: string
required:
- type
+ - logprobs
- output_index
- item_id
- content_index
- - text
+ - delta
- sequence_number
- description: Event emitted when reasoning text streaming is complete
+ type: object
+ BaseTextDoneEvent:
+ description: Event emitted when text streaming is complete
example:
- type: response.reasoning_text.done
- output_index: 0
- item_id: item-1
content_index: 0
- text: First, we need to identify the key components and then combine them logically.
- sequence_number: 6
- ReasoningDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningDoneEvent'
- - type: object
- properties: {}
- description: Event emitted when reasoning text streaming is complete
- example:
- type: response.reasoning_text.done
- output_index: 0
item_id: item-1
- content_index: 0
- text: First, we need to identify the key components and then combine them logically.
+ logprobs: []
+ output_index: 0
sequence_number: 6
- BaseReasoningSummaryPartAddedEvent:
- type: object
+ text: Hello! How can I help you?
+ type: response.output_text.done
properties:
- type:
+ content_index:
+ type: integer
+ item_id:
type: string
- enum:
- - response.reasoning_summary_part.added
+ logprobs:
+ items:
+ $ref: '#/components/schemas/OpenResponsesLogProbs'
+ type: array
output_index:
type: integer
- item_id:
- type: string
- summary_index:
- type: integer
- part:
- $ref: '#/components/schemas/ReasoningSummaryText'
sequence_number:
type: integer
- required:
- - type
- - output_index
- - item_id
- - summary_index
- - part
- - sequence_number
- description: Event emitted when a reasoning summary part is added
- example:
- type: response.reasoning_summary_part.added
- output_index: 0
- item_id: item-1
- summary_index: 0
- part:
- type: summary_text
- text: ''
- sequence_number: 3
- ReasoningSummaryPartAddedEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent'
- - type: object
- properties: {}
- description: Event emitted when a reasoning summary part is added
- example:
- type: response.reasoning_summary_part.added
- output_index: 0
- item_id: item-1
- summary_index: 0
- part:
- type: summary_text
- text: ''
- sequence_number: 3
- BaseReasoningSummaryPartDoneEvent:
- type: object
- properties:
- type:
+ text:
type: string
+ type:
enum:
- - response.reasoning_summary_part.done
- output_index:
- type: integer
- item_id:
+ - response.output_text.done
type: string
- summary_index:
- type: integer
- part:
- $ref: '#/components/schemas/ReasoningSummaryText'
- sequence_number:
- type: integer
required:
- type
- output_index
- item_id
- - summary_index
- - part
+ - content_index
+ - text
- sequence_number
- description: Event emitted when a reasoning summary part is complete
- example:
- type: response.reasoning_summary_part.done
- output_index: 0
- item_id: item-1
- summary_index: 0
- part:
- type: summary_text
- text: Analyzing the problem step by step to find the optimal solution.
- sequence_number: 7
- ReasoningSummaryPartDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningSummaryPartDoneEvent'
- - type: object
- properties: {}
- description: Event emitted when a reasoning summary part is complete
+ - logprobs
+ type: object
+ BigNumberUnion:
+ description: Price per million prompt tokens
+ example: 1000
+ type: string
+ BulkAssignKeysRequest:
example:
- type: response.reasoning_summary_part.done
- output_index: 0
- item_id: item-1
- summary_index: 0
- part:
- type: summary_text
- text: Analyzing the problem step by step to find the optimal solution.
- sequence_number: 7
- BaseReasoningSummaryTextDeltaEvent:
+ key_hashes:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ properties:
+ key_hashes:
+ description: Array of API key hashes to assign to the guardrail
+ example:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ items:
+ minLength: 1
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - key_hashes
type: object
+ BulkAssignKeysResponse:
+ example:
+ assigned_count: 3
properties:
- type:
- type: string
- enum:
- - response.reasoning_summary_text.delta
- item_id:
- type: string
- output_index:
- type: integer
- summary_index:
- type: integer
- delta:
- type: string
- sequence_number:
+ assigned_count:
+ description: Number of keys successfully assigned
+ example: 3
type: integer
required:
- - type
- - item_id
- - output_index
- - summary_index
- - delta
- - sequence_number
- description: Event emitted when reasoning summary text delta is streamed
- example:
- type: response.reasoning_summary_text.delta
- item_id: item-1
- output_index: 0
- summary_index: 0
- delta: Analyzing
- sequence_number: 4
- ReasoningSummaryTextDeltaEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningSummaryTextDeltaEvent'
- - type: object
- properties: {}
- description: Event emitted when reasoning summary text delta is streamed
+ - assigned_count
+ type: object
+ BulkAssignMembersRequest:
example:
- type: response.reasoning_summary_text.delta
- item_id: item-1
- output_index: 0
- summary_index: 0
- delta: Analyzing
- sequence_number: 4
- BaseReasoningSummaryTextDoneEvent:
+ member_user_ids:
+ - user_abc123
+ - user_def456
+ properties:
+ member_user_ids:
+ description: Array of member user IDs to assign to the guardrail
+ example:
+ - user_abc123
+ - user_def456
+ items:
+ minLength: 1
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - member_user_ids
type: object
+ BulkAssignMembersResponse:
+ example:
+ assigned_count: 2
properties:
- type:
- type: string
- enum:
- - response.reasoning_summary_text.done
- item_id:
- type: string
- output_index:
- type: integer
- summary_index:
- type: integer
- text:
- type: string
- sequence_number:
+ assigned_count:
+ description: Number of members successfully assigned
+ example: 2
type: integer
required:
- - type
- - item_id
- - output_index
- - summary_index
- - text
- - sequence_number
- description: Event emitted when reasoning summary text streaming is complete
- example:
- type: response.reasoning_summary_text.done
- item_id: item-1
- output_index: 0
- summary_index: 0
- text: Analyzing the problem step by step to find the optimal solution.
- sequence_number: 6
- ReasoningSummaryTextDoneEvent:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningSummaryTextDoneEvent'
- - type: object
- properties: {}
- description: Event emitted when reasoning summary text streaming is complete
+ - assigned_count
+ type: object
+ BulkUnassignKeysRequest:
example:
- type: response.reasoning_summary_text.done
- item_id: item-1
- output_index: 0
- summary_index: 0
- text: Analyzing the problem step by step to find the optimal solution.
- sequence_number: 6
- OpenAIResponsesImageGenCallInProgress:
+ key_hashes:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ properties:
+ key_hashes:
+ description: Array of API key hashes to unassign from the guardrail
+ example:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ items:
+ minLength: 1
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - key_hashes
type: object
+ BulkUnassignKeysResponse:
+ example:
+ unassigned_count: 3
properties:
- type:
- type: string
- enum:
- - response.image_generation_call.in_progress
- item_id:
- type: string
- output_index:
- type: integer
- sequence_number:
+ unassigned_count:
+ description: Number of keys successfully unassigned
+ example: 3
type: integer
required:
- - type
- - item_id
- - output_index
- - sequence_number
+ - unassigned_count
+ type: object
+ BulkUnassignMembersRequest:
example:
- type: response.image_generation_call.in_progress
- item_id: ig_abc123
- output_index: 0
- sequence_number: 1
- ImageGenCallInProgressEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesImageGenCallInProgress'
- - type: object
- properties: {}
- example:
- type: response.image_generation_call.in_progress
- output_index: 0
- sequence_number: 1
- item_id: call-123
- description: Image generation call in progress
- OpenAIResponsesImageGenCallGenerating:
+ member_user_ids:
+ - user_abc123
+ - user_def456
+ properties:
+ member_user_ids:
+ description: Array of member user IDs to unassign from the guardrail
+ example:
+ - user_abc123
+ - user_def456
+ items:
+ minLength: 1
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - member_user_ids
type: object
+ BulkUnassignMembersResponse:
+ example:
+ unassigned_count: 2
properties:
- type:
- type: string
- enum:
- - response.image_generation_call.generating
- item_id:
- type: string
- output_index:
- type: integer
- sequence_number:
+ unassigned_count:
+ description: Number of members successfully unassigned
+ example: 2
type: integer
required:
- - type
- - item_id
- - output_index
- - sequence_number
+ - unassigned_count
+ type: object
+ ChatAssistantImages:
+ description: Generated images from image generation models
example:
- type: response.image_generation_call.generating
- item_id: ig_abc123
- output_index: 0
- sequence_number: 2
- ImageGenCallGeneratingEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesImageGenCallGenerating'
- - type: object
- properties: {}
+ - image_url:
+ url: data:image/png;base64,iVBORw0KGgo...
+ items:
+ properties:
+ image_url:
+ properties:
+ url:
+ description: URL or base64-encoded data of the generated image
+ type: string
+ required:
+ - url
+ type: object
+ required:
+ - image_url
+ type: object
+ type: array
+ ChatAssistantMessage:
+ description: Assistant message for requests and responses
example:
- type: response.image_generation_call.generating
- output_index: 0
- sequence_number: 2
- item_id: call-123
- description: Image generation call is generating
- OpenAIResponsesImageGenCallPartialImage:
- type: object
+ content: The capital of France is Paris.
+ role: assistant
properties:
- type:
+ audio:
+ $ref: '#/components/schemas/ChatAudioOutput'
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/ChatContentItems'
+ type: array
+ - nullable: true
+ description: Assistant message content
+ images:
+ $ref: '#/components/schemas/ChatAssistantImages'
+ name:
+ description: Optional name for the assistant
type: string
- enum:
- - response.image_generation_call.partial_image
- item_id:
+ reasoning:
+ description: Reasoning output
+ nullable: true
type: string
- output_index:
- type: integer
- sequence_number:
- type: integer
- partial_image_b64:
+ reasoning_details:
+ $ref: '#/components/schemas/ChatReasoningDetails'
+ refusal:
+ description: Refusal message if content was refused
+ nullable: true
type: string
- partial_image_index:
- type: integer
+ role:
+ enum:
+ - assistant
+ type: string
+ tool_calls:
+ description: Tool calls made by the assistant
+ items:
+ $ref: '#/components/schemas/ChatToolCall'
+ type: array
required:
- - type
- - item_id
- - output_index
- - sequence_number
- - partial_image_b64
- - partial_image_index
- example:
- type: response.image_generation_call.partial_image
- item_id: ig_abc123
- output_index: 0
- sequence_number: 3
- partial_image_b64: iVBORw0KGgo...
- partial_image_index: 0
- ImageGenCallPartialImageEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesImageGenCallPartialImage'
- - type: object
- properties: {}
- example:
- type: response.image_generation_call.partial_image
- output_index: 0
- sequence_number: 3
- item_id: call-123
- partial_image_b64: base64encodedimage...
- partial_image_index: 0
- description: Image generation call with partial image
- OpenAIResponsesImageGenCallCompleted:
+ - role
type: object
+ ChatAudioOutput:
+ description: Audio output data or reference
+ example:
+ data: UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f
+ expires_at: 1677652400
+ id: audio_abc123
+ transcript: Hello! How can I help you today?
properties:
- type:
- type: string
- enum:
- - response.image_generation_call.completed
- item_id:
+ data:
+ description: Base64 encoded audio data
type: string
- output_index:
+ expires_at:
+ description: Audio expiration timestamp
type: integer
- sequence_number:
+ id:
+ description: Audio output identifier
+ type: string
+ transcript:
+ description: Audio transcript
+ type: string
+ type: object
+ ChatChoice:
+ description: Chat completion choice
+ example:
+ finish_reason: stop
+ index: 0
+ logprobs: null
+ message:
+ content: The capital of France is Paris.
+ role: assistant
+ properties:
+ finish_reason:
+ $ref: '#/components/schemas/ChatFinishReasonEnum'
+ index:
+ description: Choice index
+ example: 0
type: integer
+ logprobs:
+ $ref: '#/components/schemas/ChatTokenLogprobs'
+ message:
+ $ref: '#/components/schemas/ChatAssistantMessage'
required:
- - type
- - item_id
- - output_index
- - sequence_number
- example:
- type: response.image_generation_call.completed
- item_id: ig_abc123
- output_index: 0
- sequence_number: 4
- ImageGenCallCompletedEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted'
- - type: object
- properties: {}
- example:
- type: response.image_generation_call.completed
- output_index: 0
- sequence_number: 4
- item_id: call-123
- description: Image generation call completed
- OpenAIResponsesWebSearchCallInProgress:
+ - finish_reason
+ - index
+ - message
type: object
+ ChatContentAudio:
+ description: Audio input content part. Supported audio formats vary by provider.
+ example:
+ input_audio:
+ data: SGVsbG8gV29ybGQ=
+ format: wav
+ type: input_audio
properties:
+ input_audio:
+ properties:
+ data:
+ description: Base64 encoded audio data
+ type: string
+ format:
+ description: >-
+ Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by
+ provider.
+ type: string
+ required:
+ - data
+ - format
+ type: object
type:
- type: string
enum:
- - response.web_search_call.in_progress
- item_id:
+ - input_audio
type: string
- output_index:
- type: integer
- sequence_number:
- type: integer
required:
- type
- - item_id
- - output_index
- - sequence_number
+ - input_audio
+ type: object
+ ChatContentCacheControl:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ - properties: {}
+ type: object
+ description: Cache control for the content part
example:
- type: response.web_search_call.in_progress
- item_id: ws_abc123
- output_index: 0
- sequence_number: 1
- WebSearchCallInProgressEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
- - type: object
- properties: {}
+ ttl: 5m
+ type: ephemeral
+ ChatContentFile:
+ description: File content part for document processing
example:
- type: response.web_search_call.in_progress
- output_index: 0
- sequence_number: 1
- item_id: ws-123
- description: Web search call in progress
- OpenAIResponsesWebSearchCallSearching:
- type: object
+ file:
+ file_data: https://example.com/document.pdf
+ filename: document.pdf
+ type: file
properties:
+ file:
+ properties:
+ file_data:
+ description: File content as base64 data URL or URL
+ type: string
+ file_id:
+ description: File ID for previously uploaded files
+ type: string
+ filename:
+ description: Original filename
+ type: string
+ type: object
type:
- type: string
enum:
- - response.web_search_call.searching
- item_id:
+ - file
type: string
- output_index:
- type: integer
- sequence_number:
- type: integer
required:
- type
- - item_id
- - output_index
- - sequence_number
- example:
- type: response.web_search_call.searching
- item_id: ws_abc123
- output_index: 0
- sequence_number: 2
- WebSearchCallSearchingEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
- - type: object
- properties: {}
- example:
- type: response.web_search_call.searching
- output_index: 0
- sequence_number: 2
- item_id: ws-123
- description: Web search call is searching
- OpenAIResponsesSearchCompleted:
+ - file
type: object
+ ChatContentImage:
+ description: Image content part for vision models
+ example:
+ image_url:
+ detail: auto
+ url: https://example.com/image.jpg
+ type: image_url
properties:
+ image_url:
+ properties:
+ detail:
+ description: Image detail level for vision models
+ enum:
+ - auto
+ - low
+ - high
+ type: string
+ url:
+ description: 'URL of the image (data: URLs supported)'
+ type: string
+ required:
+ - url
+ type: object
type:
- type: string
enum:
- - response.web_search_call.completed
- item_id:
+ - image_url
type: string
- output_index:
- type: integer
- sequence_number:
- type: integer
required:
- type
- - item_id
- - output_index
- - sequence_number
- example:
- type: response.web_search_call.completed
- item_id: ws_abc123
- output_index: 0
- sequence_number: 5
- WebSearchCallCompletedEvent:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
- - type: object
- properties: {}
- example:
- type: response.web_search_call.completed
- output_index: 0
- sequence_number: 3
- item_id: ws-123
- description: Web search call completed
- StreamEvents:
- oneOf:
- - $ref: '#/components/schemas/OpenResponsesCreatedEvent'
- - $ref: '#/components/schemas/OpenResponsesInProgressEvent'
- - $ref: '#/components/schemas/StreamEventsResponseCompleted'
- - $ref: '#/components/schemas/StreamEventsResponseIncomplete'
- - $ref: '#/components/schemas/StreamEventsResponseFailed'
- - $ref: '#/components/schemas/ErrorEvent'
- - $ref: '#/components/schemas/StreamEventsResponseOutputItemAdded'
- - $ref: '#/components/schemas/StreamEventsResponseOutputItemDone'
- - $ref: '#/components/schemas/ContentPartAddedEvent'
- - $ref: '#/components/schemas/ContentPartDoneEvent'
- - $ref: '#/components/schemas/TextDeltaEvent'
- - $ref: '#/components/schemas/TextDoneEvent'
- - $ref: '#/components/schemas/RefusalDeltaEvent'
- - $ref: '#/components/schemas/RefusalDoneEvent'
- - $ref: '#/components/schemas/AnnotationAddedEvent'
- - $ref: '#/components/schemas/FunctionCallArgsDeltaEvent'
- - $ref: '#/components/schemas/FunctionCallArgsDoneEvent'
- - $ref: '#/components/schemas/ReasoningDeltaEvent'
- - $ref: '#/components/schemas/ReasoningDoneEvent'
- - $ref: '#/components/schemas/ReasoningSummaryPartAddedEvent'
- - $ref: '#/components/schemas/ReasoningSummaryPartDoneEvent'
- - $ref: '#/components/schemas/ReasoningSummaryTextDeltaEvent'
- - $ref: '#/components/schemas/ReasoningSummaryTextDoneEvent'
- - $ref: '#/components/schemas/ImageGenCallInProgressEvent'
- - $ref: '#/components/schemas/ImageGenCallGeneratingEvent'
- - $ref: '#/components/schemas/ImageGenCallPartialImageEvent'
- - $ref: '#/components/schemas/ImageGenCallCompletedEvent'
- - $ref: '#/components/schemas/WebSearchCallInProgressEvent'
- - $ref: '#/components/schemas/WebSearchCallSearchingEvent'
- - $ref: '#/components/schemas/WebSearchCallCompletedEvent'
+ - image_url
+ type: object
+ ChatContentItems:
+ description: Content part for chat completion messages
discriminator:
- propertyName: type
mapping:
- response.created: '#/components/schemas/OpenResponsesCreatedEvent'
- response.in_progress: '#/components/schemas/OpenResponsesInProgressEvent'
- response.completed: '#/components/schemas/StreamEventsResponseCompleted'
- response.incomplete: '#/components/schemas/StreamEventsResponseIncomplete'
- response.failed: '#/components/schemas/StreamEventsResponseFailed'
- error: '#/components/schemas/ErrorEvent'
- response.output_item.added: '#/components/schemas/StreamEventsResponseOutputItemAdded'
- response.output_item.done: '#/components/schemas/StreamEventsResponseOutputItemDone'
- response.content_part.added: '#/components/schemas/ContentPartAddedEvent'
- response.content_part.done: '#/components/schemas/ContentPartDoneEvent'
- response.output_text.delta: '#/components/schemas/TextDeltaEvent'
- response.output_text.done: '#/components/schemas/TextDoneEvent'
- response.refusal.delta: '#/components/schemas/RefusalDeltaEvent'
- response.refusal.done: '#/components/schemas/RefusalDoneEvent'
- response.output_text.annotation.added: '#/components/schemas/AnnotationAddedEvent'
- response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent'
- response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent'
- response.reasoning_text.delta: '#/components/schemas/ReasoningDeltaEvent'
- response.reasoning_text.done: '#/components/schemas/ReasoningDoneEvent'
- response.reasoning_summary_part.added: '#/components/schemas/ReasoningSummaryPartAddedEvent'
- response.reasoning_summary_part.done: '#/components/schemas/ReasoningSummaryPartDoneEvent'
- response.reasoning_summary_text.delta: '#/components/schemas/ReasoningSummaryTextDeltaEvent'
- response.reasoning_summary_text.done: '#/components/schemas/ReasoningSummaryTextDoneEvent'
- response.image_generation_call.in_progress: '#/components/schemas/ImageGenCallInProgressEvent'
- response.image_generation_call.generating: '#/components/schemas/ImageGenCallGeneratingEvent'
- response.image_generation_call.partial_image: '#/components/schemas/ImageGenCallPartialImageEvent'
- response.image_generation_call.completed: '#/components/schemas/ImageGenCallCompletedEvent'
- response.web_search_call.in_progress: '#/components/schemas/WebSearchCallInProgressEvent'
- response.web_search_call.searching: '#/components/schemas/WebSearchCallSearchingEvent'
- response.web_search_call.completed: '#/components/schemas/WebSearchCallCompletedEvent'
- description: Union of all possible event types emitted during response streaming
+ file: '#/components/schemas/ChatContentFile'
+ image_url: '#/components/schemas/ChatContentImage'
+ input_audio: '#/components/schemas/ChatContentAudio'
+ input_video: '#/components/schemas/Legacy_ChatContentVideo'
+ text: '#/components/schemas/ChatContentText'
+ video_url: '#/components/schemas/ChatContentVideo'
+ propertyName: type
example:
- type: response.created
- response:
- id: resp-abc123
- object: response
- created_at: 1704067200
- model: gpt-4
- status: in_progress
- output: []
- tools: []
- tool_choice: auto
- parallel_tool_calls: true
- error: null
- incomplete_details: null
- metadata: null
- instructions: null
- temperature: null
- top_p: null
- max_output_tokens: null
- sequence_number: 0
- BadRequestResponseErrorData:
- type: object
+ text: Hello, world!
+ type: text
+ oneOf:
+ - $ref: '#/components/schemas/ChatContentText'
+ - $ref: '#/components/schemas/ChatContentImage'
+ - $ref: '#/components/schemas/ChatContentAudio'
+ - $ref: '#/components/schemas/Legacy_ChatContentVideo'
+ - $ref: '#/components/schemas/ChatContentVideo'
+ - $ref: '#/components/schemas/ChatContentFile'
+ ChatContentText:
+ description: Text content part
+ example:
+ text: Hello, world!
+ type: text
properties:
- code:
- type: integer
- message:
+ cache_control:
+ $ref: '#/components/schemas/ChatContentCacheControl'
+ text:
+ type: string
+ type:
+ enum:
+ - text
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- - code
- - message
- description: Error data for BadRequestResponse
- example:
- code: 400
- message: Invalid request parameters
- BadRequestResponse:
+ - type
+ - text
type: object
+ ChatContentVideo:
+ description: Video input content part
+ example:
+ type: video_url
+ video_url:
+ url: https://example.com/video.mp4
properties:
- error:
- $ref: '#/components/schemas/BadRequestResponseErrorData'
- user_id:
+ type:
+ enum:
+ - video_url
type: string
- nullable: true
- required:
- - error
- description: Bad Request - Invalid request parameters or malformed input
- example:
- error:
- code: 400
- message: Invalid request parameters
- UnauthorizedResponseErrorData:
- type: object
- properties:
- code:
- type: integer
- message:
- type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
+ video_url:
+ $ref: '#/components/schemas/ChatContentVideoInput'
required:
- - code
- - message
- description: Error data for UnauthorizedResponse
- example:
- code: 401
- message: Missing Authentication header
- UnauthorizedResponse:
+ - type
+ - video_url
type: object
- properties:
- error:
- $ref: '#/components/schemas/UnauthorizedResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Unauthorized - Authentication required or invalid credentials
+ ChatContentVideoInput:
+ description: Video input object
example:
- error:
- code: 401
- message: Missing Authentication header
- PaymentRequiredResponseErrorData:
- type: object
+ url: https://example.com/video.mp4
properties:
- code:
- type: integer
- message:
+ url:
+ description: 'URL of the video (data: URLs supported)'
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- - code
- - message
- description: Error data for PaymentRequiredResponse
- example:
- code: 402
- message: Insufficient credits. Add more using https://openrouter.ai/credits
- PaymentRequiredResponse:
+ - url
type: object
- properties:
- error:
- $ref: '#/components/schemas/PaymentRequiredResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Payment Required - Insufficient credits or quota to complete request
+ ChatDebugOptions:
+ description: Debug options for inspecting request transformations (streaming only)
example:
- error:
- code: 402
- message: Insufficient credits. Add more using https://openrouter.ai/credits
- NotFoundResponseErrorData:
- type: object
+ echo_upstream_body: true
properties:
- code:
- type: integer
- message:
- type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for NotFoundResponse
- example:
- code: 404
- message: Resource not found
- NotFoundResponse:
+ echo_upstream_body:
+ description: >-
+ If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only
+ works with streaming mode.
+ example: true
+ type: boolean
type: object
+ ChatDeveloperMessage:
+ description: Developer message
+ example:
+ content: This is a message from the developer.
+ role: developer
properties:
- error:
- $ref: '#/components/schemas/NotFoundResponseErrorData'
- user_id:
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/ChatContentText'
+ type: array
+ description: Developer message content
+ example: This is a message from the developer.
+ name:
+ description: Optional name for the developer message
+ example: Developer
+ type: string
+ role:
+ enum:
+ - developer
type: string
- nullable: true
required:
+ - role
+ - content
+ type: object
+ ChatFinishReasonEnum:
+ enum:
+ - tool_calls
+ - stop
+ - length
+ - content_filter
- error
- description: Not Found - Resource does not exist
+ - null
+ example: stop
+ nullable: true
+ type: string
+ ChatFormatGrammarConfig:
+ description: Custom grammar response format
example:
- error:
- code: 404
- message: Resource not found
- RequestTimeoutResponseErrorData:
- type: object
+ grammar: root ::= "yes" | "no"
+ type: grammar
properties:
- code:
- type: integer
- message:
+ grammar:
+ description: Custom grammar for text generation
+ example: root ::= "yes" | "no"
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for RequestTimeoutResponse
- example:
- code: 408
- message: Operation timed out. Please try again later.
- RequestTimeoutResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/RequestTimeoutResponseErrorData'
- user_id:
+ type:
+ enum:
+ - grammar
type: string
- nullable: true
required:
- - error
- description: Request Timeout - Operation exceeded time limit
- example:
- error:
- code: 408
- message: Operation timed out. Please try again later.
- PayloadTooLargeResponseErrorData:
+ - type
+ - grammar
type: object
+ ChatFormatJsonSchemaConfig:
+ description: JSON Schema response format for structured outputs
+ example:
+ json_schema:
+ name: math_response
+ schema:
+ properties:
+ answer:
+ type: number
+ required:
+ - answer
+ type: object
+ type: json_schema
properties:
- code:
- type: integer
- message:
+ json_schema:
+ $ref: '#/components/schemas/ChatJsonSchemaConfig'
+ type:
+ enum:
+ - json_schema
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- - code
- - message
- description: Error data for PayloadTooLargeResponse
- example:
- code: 413
- message: Request payload too large
- PayloadTooLargeResponse:
+ - type
+ - json_schema
type: object
+ ChatFormatPythonConfig:
+ description: Python code response format
+ example:
+ type: python
properties:
- error:
- $ref: '#/components/schemas/PayloadTooLargeResponseErrorData'
- user_id:
+ type:
+ enum:
+ - python
type: string
- nullable: true
required:
- - error
- description: Payload Too Large - Request payload exceeds size limits
- example:
- error:
- code: 413
- message: Request payload too large
- UnprocessableEntityResponseErrorData:
+ - type
type: object
+ ChatFormatTextConfig:
+ description: Default text response format
+ example:
+ type: text
properties:
- code:
- type: integer
- message:
+ type:
+ enum:
+ - text
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- - code
- - message
- description: Error data for UnprocessableEntityResponse
- example:
- code: 422
- message: Invalid argument
- UnprocessableEntityResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/UnprocessableEntityResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Unprocessable Entity - Semantic validation failure
- example:
- error:
- code: 422
- message: Invalid argument
- TooManyRequestsResponseErrorData:
+ - type
type: object
- properties:
- code:
- type: integer
- message:
- type: string
- metadata:
+ ChatFunctionTool:
+ anyOf:
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/ChatContentCacheControl'
+ function:
+ description: Function definition for tool calling
+ example:
+ description: Get the current weather for a location
+ name: get_weather
+ parameters:
+ properties:
+ location:
+ description: City name
+ type: string
+ required:
+ - location
+ type: object
+ properties:
+ description:
+ description: Function description for the model
+ example: Get the current weather for a location
+ type: string
+ name:
+ description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
+ example: get_weather
+ maxLength: 64
+ type: string
+ parameters:
+ additionalProperties:
+ nullable: true
+ description: Function parameters as JSON Schema object
+ example:
+ properties:
+ location:
+ description: City name
+ type: string
+ required:
+ - location
+ type: object
+ type: object
+ strict:
+ description: Enable strict schema adherence
+ example: false
+ nullable: true
+ type: boolean
+ required:
+ - name
+ type: object
+ type:
+ enum:
+ - function
+ type: string
+ required:
+ - type
+ - function
type: object
- nullable: true
- additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for TooManyRequestsResponse
+ - $ref: '#/components/schemas/DatetimeServerTool'
+ - $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
+ - $ref: '#/components/schemas/ChatWebSearchShorthand'
+ description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
example:
- code: 429
- message: Rate limit exceeded
- TooManyRequestsResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/TooManyRequestsResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Too Many Requests - Rate limit exceeded
+ function:
+ description: Get the current weather for a location
+ name: get_weather
+ parameters:
+ properties:
+ location:
+ description: City name
+ type: string
+ unit:
+ enum:
+ - celsius
+ - fahrenheit
+ type: string
+ required:
+ - location
+ type: object
+ type: function
+ ChatJsonSchemaConfig:
+ description: JSON Schema configuration object
example:
- error:
- code: 429
- message: Rate limit exceeded
- InternalServerResponseErrorData:
- type: object
+ description: A mathematical response
+ name: math_response
+ schema:
+ properties:
+ answer:
+ type: number
+ required:
+ - answer
+ type: object
+ strict: true
properties:
- code:
- type: integer
- message:
+ description:
+ description: Schema description for the model
+ example: A mathematical response
type: string
- metadata:
- type: object
- nullable: true
+ name:
+ description: Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
+ example: math_response
+ maxLength: 64
+ type: string
+ schema:
additionalProperties:
nullable: true
- required:
- - code
- - message
- description: Error data for InternalServerResponse
- example:
- code: 500
- message: Internal Server Error
- InternalServerResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/InternalServerResponseErrorData'
- user_id:
- type: string
+ description: JSON Schema object
+ example:
+ properties:
+ answer:
+ type: number
+ required:
+ - answer
+ type: object
+ type: object
+ strict:
+ description: Enable strict schema adherence
+ example: false
nullable: true
+ type: boolean
required:
- - error
- description: Internal Server Error - Unexpected server error
- example:
- error:
- code: 500
- message: Internal Server Error
- BadGatewayResponseErrorData:
+ - name
type: object
+ ChatMessages:
+ description: Chat completion message with role-based discrimination
+ discriminator:
+ mapping:
+ assistant: '#/components/schemas/ChatAssistantMessage'
+ developer: '#/components/schemas/ChatDeveloperMessage'
+ system: '#/components/schemas/ChatSystemMessage'
+ tool: '#/components/schemas/ChatToolMessage'
+ user: '#/components/schemas/ChatUserMessage'
+ propertyName: role
+ example:
+ content: What is the capital of France?
+ role: user
+ oneOf:
+ - $ref: '#/components/schemas/ChatSystemMessage'
+ - $ref: '#/components/schemas/ChatUserMessage'
+ - $ref: '#/components/schemas/ChatDeveloperMessage'
+ - $ref: '#/components/schemas/ChatAssistantMessage'
+ - $ref: '#/components/schemas/ChatToolMessage'
+ ChatModelNames:
+ description: Models to use for completion
+ example:
+ - openai/gpt-4
+ - openai/gpt-4o
+ items:
+ allOf:
+ - $ref: '#/components/schemas/ModelName'
+ - description: Available OpenRouter chat completion models
+ type: array
+ ChatNamedToolChoice:
+ description: Named tool choice for specific function
+ example:
+ function:
+ name: get_weather
+ type: function
properties:
- code:
- type: integer
- message:
- type: string
- metadata:
+ function:
+ properties:
+ name:
+ description: Function name to call
+ example: get_weather
+ type: string
+ required:
+ - name
type: object
- nullable: true
- additionalProperties:
- nullable: true
+ type:
+ enum:
+ - function
+ type: string
required:
- - code
- - message
- description: Error data for BadGatewayResponse
- example:
- code: 502
- message: Provider returned error
- BadGatewayResponse:
+ - type
+ - function
type: object
- properties:
- error:
- $ref: '#/components/schemas/BadGatewayResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Bad Gateway - Provider/upstream API failure
+ ChatReasoningDetails:
+ description: Reasoning details for extended thinking models
example:
- error:
- code: 502
- message: Provider returned error
- ServiceUnavailableResponseErrorData:
- type: object
+ - thinking: Let me work through this step by step...
+ type: thinking
+ items:
+ $ref: '#/components/schemas/ReasoningDetailUnion'
+ type: array
+ ChatReasoningSummaryVerbosityEnum:
+ enum:
+ - auto
+ - concise
+ - detailed
+ - null
+ example: concise
+ nullable: true
+ type: string
+ ChatRequest:
+ description: Chat completion request parameters
+ example:
+ max_tokens: 150
+ messages:
+ - content: You are a helpful assistant.
+ role: system
+ - content: What is the capital of France?
+ role: user
+ model: openai/gpt-4
+ temperature: 0.7
properties:
- code:
- type: integer
- message:
- type: string
- metadata:
+ cache_control:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ - description: >-
+ Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the
+ last cacheable block in the request. Currently supported for Anthropic Claude models.
+ debug:
+ $ref: '#/components/schemas/ChatDebugOptions'
+ frequency_penalty:
+ description: Frequency penalty (-2.0 to 2.0)
+ example: 0
+ format: double
+ type: number
+ image_config:
+ additionalProperties:
+ anyOf:
+ - type: string
+ - format: double
+ type: number
+ - items:
+ nullable: true
+ type: array
+ description: >-
+ Provider-specific image configuration options. Keys and values vary by model/provider. See
+ https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.
+ example:
+ aspect_ratio: '16:9'
type: object
- nullable: true
+ logit_bias:
additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for ServiceUnavailableResponse
- example:
- code: 503
- message: Service temporarily unavailable
- ServiceUnavailableResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/ServiceUnavailableResponseErrorData'
- user_id:
- type: string
+ format: double
+ type: number
+ description: Token logit bias adjustments
+ example:
+ '50256': -100
nullable: true
- required:
- - error
- description: Service Unavailable - Service temporarily unavailable
- example:
- error:
- code: 503
- message: Service temporarily unavailable
- EdgeNetworkTimeoutResponseErrorData:
- type: object
- properties:
- code:
- type: integer
- message:
- type: string
- metadata:
type: object
+ logprobs:
+ description: Return log probabilities
+ example: false
nullable: true
- additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for EdgeNetworkTimeoutResponse
- example:
- code: 524
- message: Request timed out. Please try again later.
- EdgeNetworkTimeoutResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Infrastructure Timeout - Provider request timed out at edge network
- example:
- error:
- code: 524
- message: Request timed out. Please try again later.
- ProviderOverloadedResponseErrorData:
- type: object
- properties:
- code:
+ type: boolean
+ max_completion_tokens:
+ description: Maximum tokens in completion
+ example: 100
type: integer
- message:
- type: string
+ max_tokens:
+ description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.'
+ example: 100
+ type: integer
+ messages:
+ description: List of messages for the conversation
+ example:
+ - content: Hello!
+ role: user
+ items:
+ $ref: '#/components/schemas/ChatMessages'
+ minItems: 1
+ type: array
metadata:
- type: object
- nullable: true
additionalProperties:
- nullable: true
- required:
- - code
- - message
- description: Error data for ProviderOverloadedResponse
- example:
- code: 529
- message: Provider returned error
- ProviderOverloadedResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/ProviderOverloadedResponseErrorData'
- user_id:
- type: string
+ type: string
+ description: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)
+ example:
+ session_id: session-456
+ user_id: user-123
+ type: object
+ modalities:
+ description: Output modalities for the response. Supported values are "text", "image", and "audio".
+ example:
+ - text
+ - image
+ items:
+ enum:
+ - text
+ - image
+ - audio
+ type: string
+ type: array
+ model:
+ $ref: '#/components/schemas/ModelName'
+ models:
+ $ref: '#/components/schemas/ChatModelNames'
+ parallel_tool_calls:
+ description: >-
+ Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool
+ calls in a single response.
+ example: true
nullable: true
- required:
- - error
- description: Provider Overloaded - Provider is temporarily overloaded
- example:
- error:
- code: 529
- message: Provider returned error
- ReasoningItem:
- allOf:
- - $ref: '#/components/schemas/OutputItemReasoning'
- - type: object
+ type: boolean
+ plugins:
+ description: Plugins you want to enable for this request, including their settings.
+ items:
+ discriminator:
+ mapping:
+ auto-router: '#/components/schemas/AutoRouterPlugin'
+ context-compression: '#/components/schemas/ContextCompressionPlugin'
+ file-parser: '#/components/schemas/FileParserPlugin'
+ moderation: '#/components/schemas/ModerationPlugin'
+ response-healing: '#/components/schemas/ResponseHealingPlugin'
+ web: '#/components/schemas/WebSearchPlugin'
+ propertyName: id
+ oneOf:
+ - $ref: '#/components/schemas/AutoRouterPlugin'
+ - $ref: '#/components/schemas/ModerationPlugin'
+ - $ref: '#/components/schemas/WebSearchPlugin'
+ - $ref: '#/components/schemas/FileParserPlugin'
+ - $ref: '#/components/schemas/ResponseHealingPlugin'
+ - $ref: '#/components/schemas/ContextCompressionPlugin'
+ type: array
+ presence_penalty:
+ description: Presence penalty (-2.0 to 2.0)
+ example: 0
+ format: double
+ type: number
+ provider:
+ $ref: '#/components/schemas/ProviderPreferences'
+ reasoning:
+ description: Configuration options for reasoning models
+ example:
+ effort: medium
+ summary: concise
properties:
- content:
- type: array
+ effort:
+ description: Constrains effort on reasoning for reasoning models
+ enum:
+ - xhigh
+ - high
+ - medium
+ - low
+ - minimal
+ - none
+ - null
+ example: medium
nullable: true
- items:
- $ref: '#/components/schemas/ReasoningTextContent'
- signature:
type: string
- nullable: true
- format:
- $ref: '#/components/schemas/ReasoningFormat'
- example:
- type: reasoning
- id: reasoning-abc123
- summary:
- - type: summary_text
- text: Step by step analysis
- description: Reasoning output item with signature and format extensions
- InputVideo:
- type: object
- properties:
- type:
- type: string
+ summary:
+ $ref: '#/components/schemas/ChatReasoningSummaryVerbosityEnum'
+ type: object
+ response_format:
+ description: Response format configuration
+ discriminator:
+ mapping:
+ grammar: '#/components/schemas/ChatFormatGrammarConfig'
+ json_object: '#/components/schemas/FormatJsonObjectConfig'
+ json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig'
+ python: '#/components/schemas/ChatFormatPythonConfig'
+ text: '#/components/schemas/ChatFormatTextConfig'
+ propertyName: type
+ example:
+ type: json_object
+ oneOf:
+ - $ref: '#/components/schemas/ChatFormatTextConfig'
+ - $ref: '#/components/schemas/FormatJsonObjectConfig'
+ - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig'
+ - $ref: '#/components/schemas/ChatFormatGrammarConfig'
+ - $ref: '#/components/schemas/ChatFormatPythonConfig'
+ route:
+ $ref: '#/components/schemas/DeprecatedRoute'
+ seed:
+ description: Random seed for deterministic outputs
+ example: 42
+ type: integer
+ service_tier:
+ description: The service tier to use for processing this request.
enum:
- - input_video
- video_url:
+ - auto
+ - default
+ - flex
+ - priority
+ - scale
+ - null
+ example: auto
+ nullable: true
type: string
- description: A base64 data URL or remote URL that resolves to a video file
- required:
- - type
- - video_url
- description: Video input content item
- example:
- type: input_video
- video_url: https://example.com/video.mp4
- EasyInputMessage:
- type: object
- properties:
- type:
+ session_id:
+ description: >-
+ A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
+ observability. If provided in both the request body and the x-session-id header, the body value takes
+ precedence. Maximum of 256 characters.
+ maxLength: 256
type: string
- enum:
- - message
- role:
- anyOf:
- - type: string
- enum:
- - user
- - type: string
- enum:
- - system
- - type: string
- enum:
- - assistant
- - type: string
- enum:
- - developer
- content:
- anyOf:
- - type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - allOf:
- - $ref: '#/components/schemas/InputImage'
- - type: object
- properties: {}
- description: Image input content item
- example:
- type: input_image
- detail: auto
- image_url: https://example.com/image.jpg
- - $ref: '#/components/schemas/InputFile'
- - $ref: '#/components/schemas/InputAudio'
- - $ref: '#/components/schemas/InputVideo'
- - type: string
- - nullable: true
- phase:
+ stop:
anyOf:
- type: string
- enum:
- - commentary
- - type: string
- enum:
- - final_answer
+ - items:
+ type: string
+ maxItems: 4
+ type: array
- nullable: true
- description: >-
- The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer`
- for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve
- and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
- example: final_answer
+ description: Stop sequences (up to 4)
+ example:
+ - |+
+
+ stream:
+ default: false
+ description: Enable streaming response
+ example: false
+ type: boolean
+ stream_options:
+ $ref: '#/components/schemas/ChatStreamOptions'
+ temperature:
+ description: Sampling temperature (0-2)
+ example: 0.7
+ format: double
+ type: number
+ tool_choice:
+ $ref: '#/components/schemas/ChatToolChoice'
+ tools:
+ description: Available tools for function calling
+ example:
+ - function:
+ description: Get weather
+ name: get_weather
+ type: function
+ items:
+ $ref: '#/components/schemas/ChatFunctionTool'
+ type: array
+ top_logprobs:
+ description: Number of top log probabilities to return (0-20)
+ example: 5
+ type: integer
+ top_p:
+ description: Nucleus sampling parameter (0-1)
+ example: 1
+ format: double
+ type: number
+ trace:
+ $ref: '#/components/schemas/TraceConfig'
+ user:
+ description: Unique user identifier
+ example: user-123
+ type: string
required:
- - role
- example:
- role: user
- content: What is the weather today?
- InputMessageItem:
+ - messages
type: object
+ ChatResult:
+ description: Chat completion response
+ example:
+ choices:
+ - finish_reason: stop
+ index: 0
+ message:
+ content: The capital of France is Paris.
+ role: assistant
+ created: 1677652288
+ id: chatcmpl-123
+ model: openai/gpt-4
+ object: chat.completion
+ usage:
+ completion_tokens: 15
+ prompt_tokens: 10
+ total_tokens: 25
properties:
+ choices:
+ description: List of completion choices
+ items:
+ $ref: '#/components/schemas/ChatChoice'
+ type: array
+ created:
+ description: Unix timestamp of creation
+ example: 1677652288
+ type: integer
id:
+ description: Unique completion identifier
+ example: chatcmpl-123
type: string
- type:
+ model:
+ description: Model used for completion
+ example: openai/gpt-4
type: string
+ object:
enum:
- - message
- role:
- anyOf:
- - type: string
- enum:
- - user
- - type: string
- enum:
- - system
- - type: string
- enum:
- - developer
- content:
- type: array
+ - chat.completion
+ type: string
+ service_tier:
+ description: The service tier used by the upstream provider for this request
+ example: default
nullable: true
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - allOf:
- - $ref: '#/components/schemas/InputImage'
- - type: object
- properties: {}
- description: Image input content item
- example:
- type: input_image
- detail: auto
- image_url: https://example.com/image.jpg
- - $ref: '#/components/schemas/InputFile'
- - $ref: '#/components/schemas/InputAudio'
- - $ref: '#/components/schemas/InputVideo'
+ type: string
+ system_fingerprint:
+ description: System fingerprint
+ example: fp_44709d6fcb
+ nullable: true
+ type: string
+ usage:
+ $ref: '#/components/schemas/ChatUsage'
required:
- - role
- example:
- id: msg-abc123
- type: message
- role: user
- content:
- - type: input_text
- text: Hello, how are you?
- FunctionCallItem:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponseFunctionToolCall'
- - type: object
- properties: {}
- required:
- - id
+ - id
+ - choices
+ - created
+ - model
+ - object
+ - system_fingerprint
+ type: object
+ ChatStreamChoice:
+ description: Streaming completion choice chunk
example:
- id: call-abc123
- type: function_call
- call_id: call-abc123
- name: get_weather
- arguments: '{"location":"San Francisco"}'
- status: completed
- description: A function call initiated by the model
- FunctionCallOutputItem:
- allOf:
- - $ref: '#/components/schemas/OpenAIResponseFunctionToolCallOutput'
- - type: object
- properties:
- output:
- anyOf:
- - type: string
- - type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/InputText'
- - allOf:
- - $ref: '#/components/schemas/InputImage'
- - type: object
- properties: {}
- description: Image input content item
- example:
- type: input_image
- detail: auto
- image_url: https://example.com/image.jpg
- - $ref: '#/components/schemas/InputFile'
- example:
- type: function_call_output
- id: output-abc123
- call_id: call-abc123
- output: '{"temperature":72,"conditions":"sunny"}'
- status: completed
- description: The output from a function call execution
- Inputs:
- anyOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/ReasoningItem'
- - $ref: '#/components/schemas/EasyInputMessage'
- - $ref: '#/components/schemas/InputMessageItem'
- - $ref: '#/components/schemas/FunctionCallItem'
- - $ref: '#/components/schemas/FunctionCallOutputItem'
- - allOf:
- - $ref: '#/components/schemas/OutputMessageItem'
- - type: object
- properties:
- content:
- anyOf:
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/ResponseOutputText'
- - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
- - type: string
- - nullable: true
- example:
- id: msg-123
- type: message
- role: assistant
- status: completed
- content:
- - type: output_text
- text: Hello! How can I help you?
- annotations: []
- description: An output message item
- - allOf:
- - $ref: '#/components/schemas/OutputReasoningItem'
- - type: object
- properties:
- summary:
- type: array
- nullable: true
- items:
- $ref: '#/components/schemas/ReasoningSummaryText'
- example:
- id: reasoning-123
- type: reasoning
- status: completed
- summary:
- - type: summary_text
- text: Analyzed the problem and found the optimal solution.
- content:
- - type: reasoning_text
- text: First, we analyze the problem...
- signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
- format: anthropic-claude-v1
- description: An output item containing reasoning
- - $ref: '#/components/schemas/OutputFunctionCallItem'
- - $ref: '#/components/schemas/OutputWebSearchCallItem'
- - $ref: '#/components/schemas/OutputFileSearchCallItem'
- - $ref: '#/components/schemas/OutputImageGenerationCallItem'
- - $ref: '#/components/schemas/OutputDatetimeItem'
- - $ref: '#/components/schemas/OutputWebSearchServerToolItem'
- description: Input for a response request - can be a string or array of items
- example:
- - role: user
- content: What is the weather today?
- DatetimeServerTool:
+ delta:
+ content: Hello
+ role: assistant
+ finish_reason: null
+ index: 0
+ properties:
+ delta:
+ $ref: '#/components/schemas/ChatStreamDelta'
+ finish_reason:
+ $ref: '#/components/schemas/ChatFinishReasonEnum'
+ index:
+ description: Choice index
+ example: 0
+ type: integer
+ logprobs:
+ $ref: '#/components/schemas/ChatTokenLogprobs'
+ required:
+ - delta
+ - finish_reason
+ - index
type: object
+ ChatStreamChunk:
+ description: Streaming chat completion chunk
+ example:
+ choices:
+ - delta:
+ content: Hello
+ role: assistant
+ finish_reason: null
+ index: 0
+ created: 1677652288
+ id: chatcmpl-123
+ model: openai/gpt-4
+ object: chat.completion.chunk
properties:
- type:
- type: string
- enum:
- - openrouter:datetime
- parameters:
- type: object
+ choices:
+ description: List of streaming chunk choices
+ items:
+ $ref: '#/components/schemas/ChatStreamChoice'
+ type: array
+ created:
+ description: Unix timestamp of creation
+ example: 1677652288
+ type: integer
+ error:
+ description: Error information
+ example:
+ code: 429
+ message: Rate limit exceeded
properties:
- timezone:
+ code:
+ description: Error code
+ example: 429
+ format: int32
+ type: integer
+ message:
+ description: Error message
+ example: Rate limit exceeded
type: string
- description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
- example: America/New_York
+ required:
+ - message
+ - code
+ type: object
+ id:
+ description: Unique chunk identifier
+ example: chatcmpl-123
+ type: string
+ model:
+ description: Model used for completion
+ example: openai/gpt-4
+ type: string
+ object:
+ enum:
+ - chat.completion.chunk
+ type: string
+ service_tier:
+ description: The service tier used by the upstream provider for this request
+ example: default
+ nullable: true
+ type: string
+ system_fingerprint:
+ description: System fingerprint
+ example: fp_44709d6fcb
+ type: string
+ usage:
+ $ref: '#/components/schemas/ChatUsage'
required:
- - type
- description: 'OpenRouter built-in server tool: returns the current date and time'
- example:
- type: openrouter:datetime
- parameters:
- timezone: America/New_York
- WebSearchServerTool_OpenRouter:
+ - id
+ - choices
+ - created
+ - model
+ - object
type: object
+ x-speakeasy-entity: ChatStreamChunk
+ ChatStreamDelta:
+ description: Delta changes in streaming response
+ example:
+ content: Hello
+ role: assistant
properties:
- type:
+ audio:
+ allOf:
+ - $ref: '#/components/schemas/ChatAudioOutput'
+ - description: Audio output data
+ content:
+ description: Message content delta
+ example: Hello
+ nullable: true
+ type: string
+ reasoning:
+ description: Reasoning content delta
+ example: I need to
+ nullable: true
+ type: string
+ reasoning_details:
+ $ref: '#/components/schemas/ChatStreamReasoningDetails'
+ refusal:
+ description: Refusal message delta
+ example: null
+ nullable: true
type: string
+ role:
+ description: The role of the message author
enum:
- - openrouter:web_search
- parameters:
- type: object
- properties:
- max_results:
- type: integer
- description: Maximum number of search results to return per search call. Defaults to 5.
- example: 5
- max_total_results:
- type: integer
- description: >-
- Maximum total number of search results across all search calls in a single request. Once this limit is
- reached, the tool will stop returning new results.
- example: 20
- required:
- - type
- description: 'OpenRouter built-in server tool: searches the web for current information'
- example:
- type: openrouter:web_search
- parameters:
- max_results: 5
- TextExtendedConfig:
- allOf:
- - $ref: '#/components/schemas/TextConfig'
- - type: object
- properties: {}
- description: Text output configuration including format and verbosity
+ - assistant
+ example: assistant
+ type: string
+ tool_calls:
+ description: Tool calls delta
+ items:
+ $ref: '#/components/schemas/ChatStreamToolCall'
+ type: array
+ type: object
+ ChatStreamOptions:
+ description: Streaming configuration options
example:
- format:
- type: text
- ReasoningConfig:
- allOf:
- - $ref: '#/components/schemas/BaseReasoningConfig'
- - type: object
- nullable: true
- properties:
- max_tokens:
- type: integer
- enabled:
- type: boolean
- nullable: true
- example:
- summary: auto
- enabled: true
- description: Configuration for reasoning mode in the response
- OutputModalityEnum:
- type: string
- enum:
- - text
- - image
- example: text
- ResponseIncludesEnum:
- type: string
- enum:
- - file_search_call.results
- - message.input_image.image_url
- - computer_call_output.output.image_url
- - reasoning.encrypted_content
- - code_interpreter_call.outputs
- example: file_search_call.results
- OpenAIResponsesTruncation:
- type: string
+ include_usage: true
nullable: true
- enum:
- - auto
- - disabled
- - null
- example: auto
- ProviderName:
- type: string
- enum:
- - AkashML
- - AI21
- - AionLabs
- - Alibaba
- - Ambient
- - Amazon Bedrock
- - Amazon Nova
- - Anthropic
- - Arcee AI
- - AtlasCloud
- - Avian
- - Azure
- - BaseTen
- - BytePlus
- - Black Forest Labs
- - Cerebras
- - Chutes
- - Cirrascale
- - Clarifai
- - Cloudflare
- - Cohere
- - Crusoe
- - DeepInfra
- - DeepSeek
- - Featherless
- - Fireworks
- - Friendli
- - GMICloud
- - Google
- - Google AI Studio
- - Groq
- - Hyperbolic
- - Inception
- - Inceptron
- - InferenceNet
- - Ionstream
- - Infermatic
- - Io Net
- - Inflection
- - Liquid
- - Mara
- - Mancer 2
- - Minimax
- - ModelRun
- - Mistral
- - Modular
- - Moonshot AI
- - Morph
- - NCompass
- - Nebius
- - NextBit
- - Novita
- - Nvidia
- - OpenAI
- - OpenInference
- - Parasail
- - Perplexity
- - Phala
- - Reka
- - Relace
- - SambaNova
- - Seed
- - SiliconFlow
- - Sourceful
- - StepFun
- - Stealth
- - StreamLake
- - Switchpoint
- - Together
- - Upstage
- - Venice
- - WandB
- - Xiaomi
- - xAI
- - Z.AI
- - FakeProvider
- example: OpenAI
- Quantization:
- type: string
- enum:
- - int4
- - int8
- - fp4
- - fp6
- - fp8
- - fp16
- - bf16
- - fp32
- - unknown
- example: fp16
- ProviderSort:
- type: string
- enum:
- - price
- - throughput
- - latency
- - exacto
- description: The provider sorting strategy (price, throughput, latency)
- example: price
- ProviderSortConfig:
+ properties:
+ include_usage:
+ deprecated: true
+ description: 'Deprecated: This field has no effect. Full usage details are always included.'
+ example: true
+ type: boolean
type: object
+ ChatStreamReasoningDetails:
+ description: Reasoning details for extended thinking models
+ example:
+ - text: Let me think about this...
+ type: text
+ items:
+ $ref: '#/components/schemas/ReasoningDetailUnion'
+ type: array
+ ChatStreamToolCall:
+ description: Tool call delta for streaming responses
+ example:
+ function:
+ arguments: '{"location": "..."}'
+ name: get_weather
+ id: call_abc123
+ index: 0
+ type: function
properties:
- by:
+ function:
+ description: Function call details
+ properties:
+ arguments:
+ description: Function arguments as JSON string
+ example: '{"location": "..."}'
+ type: string
+ name:
+ description: Function name
+ example: get_weather
+ type: string
+ type: object
+ id:
+ description: Tool call identifier
+ example: call_abc123
type: string
- nullable: true
+ index:
+ description: Tool call index in the array
+ example: 0
+ type: integer
+ type:
+ description: Tool call type
enum:
- - price
- - throughput
- - latency
- - exacto
- - null
- description: The provider sorting strategy (price, throughput, latency)
- example: price
- partition:
+ - function
+ example: function
type: string
- nullable: true
- enum:
- - model
- - none
- - null
- description: >-
- Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback
- models remain fallbacks), "none" sorts all endpoints together regardless of model.
- example: model
- description: The provider sorting strategy (price, throughput, latency)
+ required:
+ - index
+ type: object
+ ChatSystemMessage:
+ description: System message for setting behavior
example:
- by: price
- partition: model
- BigNumberUnion:
- type: string
- description: Price per million prompt tokens
- example: 1000
- PercentileThroughputCutoffs:
+ content: You are a helpful assistant.
+ name: Assistant Config
+ role: system
+ properties:
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/ChatContentText'
+ type: array
+ description: System message content
+ example: You are a helpful assistant.
+ name:
+ description: Optional name for the system message
+ example: Assistant Config
+ type: string
+ role:
+ enum:
+ - system
+ type: string
+ required:
+ - role
+ - content
type: object
+ ChatTokenLogprob:
+ description: Token log probability information
+ example:
+ bytes: null
+ logprob: -0.612345
+ token: ' Hello'
+ top_logprobs:
+ - bytes: null
+ logprob: -0.612345
+ token: ' Hello'
properties:
- p50:
- type: number
+ bytes:
+ description: UTF-8 bytes of the token
+ items:
+ type: integer
+ nullable: true
+ type: array
+ logprob:
+ description: Log probability of the token
format: double
- description: Minimum p50 throughput (tokens/sec)
- p75:
- type: number
- format: double
- description: Minimum p75 throughput (tokens/sec)
- p90:
- type: number
- format: double
- description: Minimum p90 throughput (tokens/sec)
- p99:
type: number
- format: double
- description: Minimum p99 throughput (tokens/sec)
- description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
- example:
- p50: 100
- p90: 50
- PreferredMinThroughput:
- anyOf:
- - type: number
- format: double
- - $ref: '#/components/schemas/PercentileThroughputCutoffs'
- - nullable: true
- description: >-
- 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.
- example: 100
- PercentileLatencyCutoffs:
+ token:
+ description: The token
+ type: string
+ top_logprobs:
+ description: Top alternative tokens with probabilities
+ items:
+ properties:
+ bytes:
+ items:
+ type: integer
+ nullable: true
+ type: array
+ logprob:
+ format: double
+ type: number
+ token:
+ type: string
+ required:
+ - token
+ - logprob
+ - bytes
+ type: object
+ type: array
+ required:
+ - token
+ - logprob
+ - bytes
+ - top_logprobs
type: object
- properties:
- p50:
- type: number
- format: double
- description: Maximum p50 latency (seconds)
- p75:
- type: number
- format: double
- description: Maximum p75 latency (seconds)
- p90:
- type: number
- format: double
- description: Maximum p90 latency (seconds)
- p99:
- type: number
- format: double
- description: Maximum p99 latency (seconds)
- description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
+ ChatTokenLogprobs:
+ description: Log probabilities for the completion
example:
- p50: 5
- p90: 10
- PreferredMaxLatency:
- anyOf:
- - type: number
- format: double
- - $ref: '#/components/schemas/PercentileLatencyCutoffs'
- - nullable: true
- description: >-
- 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.
- example: 5
- ProviderPreferences:
- type: object
+ content:
+ - bytes: null
+ logprob: -0.612345
+ token: ' Hello'
+ top_logprobs: []
+ refusal: null
nullable: true
properties:
- allow_fallbacks:
- type: boolean
- nullable: true
- description: >
- Whether to allow backup providers to serve requests
-
- - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the
- next best provider.
-
- - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
- require_parameters:
- type: boolean
- nullable: true
- description: >-
- 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.
- data_collection:
- type: string
- nullable: true
- enum:
- - deny
- - allow
- - null
- example: allow
- description: >-
- Data collection setting. If no available model provider meets the requirement, your request will return an
- error.
-
- - allow: (default) allow providers which store user data non-transiently and may train on it
-
-
- - deny: use only providers which do not collect user data.
- zdr:
- type: boolean
- nullable: true
- description: >-
- Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do
- not retain prompts will be used.
- example: true
- enforce_distillable_text:
- type: boolean
- nullable: true
- description: >-
- Whether to restrict routing to only models that allow text distillation. When true, only models where the
- author has allowed distillation will be used.
- example: true
- order:
- type: array
- nullable: true
+ content:
+ description: Log probabilities for content tokens
items:
- anyOf:
- - $ref: '#/components/schemas/ProviderName'
- - type: string
- description: >-
- 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.
- example:
- - openai
- - anthropic
- only:
- type: array
+ $ref: '#/components/schemas/ChatTokenLogprob'
nullable: true
- items:
- anyOf:
- - $ref: '#/components/schemas/ProviderName'
- - type: string
- description: >-
- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider
- settings for this request.
- example:
- - openai
- - anthropic
- ignore:
type: array
- nullable: true
+ refusal:
+ description: Log probabilities for refusal tokens
items:
- anyOf:
- - $ref: '#/components/schemas/ProviderName'
- - type: string
- description: >-
- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider
- settings for this request.
- example:
- - openai
- - anthropic
- quantizations:
- type: array
+ $ref: '#/components/schemas/ChatTokenLogprob'
nullable: true
- items:
- $ref: '#/components/schemas/Quantization'
- description: A list of quantization levels to filter the provider by.
- sort:
- anyOf:
- - $ref: '#/components/schemas/ProviderSort'
- - $ref: '#/components/schemas/ProviderSortConfig'
- - nullable: true
- description: >-
- The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is
- performed.
- example: price
- max_price:
- type: object
- properties:
- prompt:
- $ref: '#/components/schemas/BigNumberUnion'
- completion:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: Price per million completion tokens
- image:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: Price per image
- audio:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: Price per audio unit
- request:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: Price per request
- description: >-
- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
- prompt and completion.
- preferred_min_throughput:
- $ref: '#/components/schemas/PreferredMinThroughput'
- preferred_max_latency:
- $ref: '#/components/schemas/PreferredMaxLatency'
- additionalProperties: false
- example:
- allow_fallbacks: true
- description: When multiple model providers are available, optionally indicate your routing preference.
- AutoRouterPlugin:
+ type: array
+ required:
+ - content
type: object
+ ChatToolCall:
+ description: Tool call made by the assistant
+ example:
+ function:
+ arguments: '{"location": "Boston, MA"}'
+ name: get_current_weather
+ id: call_abc123
+ type: function
properties:
+ function:
+ properties:
+ arguments:
+ description: Function arguments as JSON string
+ type: string
+ name:
+ description: Function name to call
+ type: string
+ required:
+ - name
+ - arguments
+ type: object
id:
+ description: Tool call identifier
type: string
+ type:
enum:
- - auto-router
- enabled:
- type: boolean
- description: Set to false to disable the auto-router plugin for this request. Defaults to true.
- allowed_models:
- type: array
- items:
- type: string
- description: >-
- List of model patterns to filter which models the auto-router can route between. Supports wildcards (e.g.,
- "anthropic/*" matches all Anthropic models). When not specified, uses the default supported models list.
- example:
- - anthropic/*
- - openai/gpt-4o
- - google/*
+ - function
+ type: string
required:
- id
- example:
- id: auto-router
- enabled: true
- allowed_models:
- - anthropic/*
- - openai/gpt-4o
- ModerationPlugin:
+ - type
+ - function
type: object
- properties:
- id:
+ ChatToolChoice:
+ anyOf:
+ - enum:
+ - none
+ type: string
+ - enum:
+ - auto
+ type: string
+ - enum:
+ - required
type: string
+ - $ref: '#/components/schemas/ChatNamedToolChoice'
+ description: Tool choice configuration
+ example: auto
+ ChatToolMessage:
+ description: Tool response message
+ example:
+ content: The weather in San Francisco is 72°F and sunny.
+ role: tool
+ tool_call_id: call_abc123
+ properties:
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/ChatContentItems'
+ type: array
+ description: Tool response content
+ example: The weather in San Francisco is 72°F and sunny.
+ role:
enum:
- - moderation
+ - tool
+ type: string
+ tool_call_id:
+ description: ID of the assistant message tool call this message responds to
+ example: call_abc123
+ type: string
required:
- - id
+ - role
+ - content
+ - tool_call_id
+ type: object
+ ChatUsage:
+ description: Token usage statistics
example:
- id: moderation
- WebSearchEngine:
- type: string
- enum:
- - native
- - exa
- - firecrawl
- - parallel
- description: The search engine to use for web search.
- example: exa
- WebSearchPlugin:
+ completion_tokens: 15
+ completion_tokens_details:
+ reasoning_tokens: 5
+ prompt_tokens: 10
+ prompt_tokens_details:
+ cached_tokens: 2
+ total_tokens: 25
+ properties:
+ completion_tokens:
+ description: Number of tokens in the completion
+ type: integer
+ completion_tokens_details:
+ description: Detailed completion token usage
+ nullable: true
+ properties:
+ accepted_prediction_tokens:
+ description: Accepted prediction tokens
+ type: integer
+ audio_tokens:
+ description: Tokens used for audio output
+ type: integer
+ reasoning_tokens:
+ description: Tokens used for reasoning
+ type: integer
+ rejected_prediction_tokens:
+ description: Rejected prediction tokens
+ type: integer
+ type: object
+ prompt_tokens:
+ description: Number of tokens in the prompt
+ type: integer
+ prompt_tokens_details:
+ description: Detailed prompt token usage
+ nullable: true
+ properties:
+ audio_tokens:
+ description: Audio input tokens
+ type: integer
+ cache_write_tokens:
+ description: Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
+ type: integer
+ cached_tokens:
+ description: Cached prompt tokens
+ type: integer
+ video_tokens:
+ description: Video input tokens
+ type: integer
+ type: object
+ total_tokens:
+ description: Total number of tokens
+ type: integer
+ required:
+ - completion_tokens
+ - prompt_tokens
+ - total_tokens
type: object
+ ChatUserMessage:
+ description: User message
+ example:
+ content: What is the capital of France?
+ role: user
properties:
- id:
+ content:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/ChatContentItems'
+ type: array
+ description: User message content
+ example: What is the capital of France?
+ name:
+ description: Optional name for the user
+ example: User
type: string
+ role:
enum:
- - web
- enabled:
- type: boolean
- description: Set to false to disable the web-search plugin for this request. Defaults to true.
- max_results:
- type: integer
- search_prompt:
+ - user
type: string
- engine:
- $ref: '#/components/schemas/WebSearchEngine'
- include_domains:
- type: array
+ required:
+ - role
+ - content
+ type: object
+ ChatWebSearchShorthand:
+ description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
+ example:
+ type: web_search_preview
+ properties:
+ allowed_domains:
+ description: >-
+ Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic,
+ OpenAI, xAI). Not supported with Firecrawl or Perplexity.
items:
type: string
- description: >-
- A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path
- filtering (e.g. "openai.com/blog").
- example:
- - example.com
- - '*.substack.com'
- - openai.com/blog
- exclude_domains:
type: array
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ excluded_domains:
+ description: >-
+ Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported
+ with Firecrawl, OpenAI (silently ignored), or Perplexity.
items:
type: string
+ type: array
+ max_results:
description: >-
- A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path
- filtering (e.g. "openai.com/blog").
- example:
- - example.com
- - '*.substack.com'
- - openai.com/blog
- required:
- - id
- example:
- id: web
- enabled: true
- max_results: 5
- PDFParserEngine:
- anyOf:
- - type: string
- enum:
- - mistral-ocr
- - native
- - cloudflare-ai
- - type: string
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
+ type: integer
+ max_total_results:
+ description: >-
+ Maximum total number of search results across all search calls in a single request. Once this limit is
+ reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
+ loops.
+ example: 20
+ type: integer
+ parameters:
+ $ref: '#/components/schemas/WebSearchConfig'
+ search_context_size:
+ $ref: '#/components/schemas/SearchQualityLevel'
+ type:
enum:
- - pdf-text
- description: >-
- The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to
- "cloudflare-ai".
- example: cloudflare-ai
- PDFParserOptions:
+ - web_search
+ - web_search_preview
+ - web_search_preview_2025_03_11
+ - web_search_2025_08_26
+ type: string
+ user_location:
+ $ref: '#/components/schemas/WebSearchUserLocationServerTool'
+ required:
+ - type
type: object
- properties:
- engine:
- $ref: '#/components/schemas/PDFParserEngine'
- description: Options for PDF parsing.
+ CodeInterpreterServerTool:
+ description: Code interpreter tool configuration
example:
- engine: cloudflare-ai
- FileParserPlugin:
- type: object
+ container: auto
+ type: code_interpreter
properties:
- id:
- type: string
- enum:
- - file-parser
- enabled:
- type: boolean
- description: Set to false to disable the file-parser plugin for this request. Defaults to true.
- pdf:
- $ref: '#/components/schemas/PDFParserOptions'
+ container:
+ anyOf:
+ - type: string
+ - properties:
+ file_ids:
+ items:
+ type: string
+ type: array
+ memory_limit:
+ enum:
+ - 1g
+ - 4g
+ - 16g
+ - 64g
+ - null
+ nullable: true
+ type: string
+ type:
+ enum:
+ - auto
+ type: string
+ required:
+ - type
+ type: object
+ type:
+ enum:
+ - code_interpreter
+ type: string
required:
- - id
+ - type
+ - container
+ type: object
+ CodexLocalShellTool:
+ description: Local shell tool configuration
example:
- id: file-parser
- enabled: true
- pdf:
- engine: cloudflare-ai
- ResponseHealingPlugin:
+ type: local_shell
+ properties:
+ type:
+ enum:
+ - local_shell
+ type: string
+ required:
+ - type
type: object
+ CompletedEvent:
+ description: Event emitted when a response has completed successfully
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output:
+ - content:
+ - annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ id: item-1
+ role: assistant
+ status: completed
+ type: message
+ parallel_tool_calls: true
+ status: completed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 10
+ type: response.completed
properties:
- id:
+ response:
+ $ref: '#/components/schemas/BaseResponsesResult'
+ sequence_number:
+ type: integer
+ type:
+ enum:
+ - response.completed
type: string
+ required:
+ - type
+ - response
+ - sequence_number
+ type: object
+ CompoundFilter:
+ description: A compound filter that combines multiple comparison or compound filters
+ example:
+ filters:
+ - key: author
+ type: eq
+ value: Alice
+ type: and
+ properties:
+ filters:
+ items:
+ additionalProperties:
+ nullable: true
+ type: object
+ type: array
+ type:
enum:
- - response-healing
- enabled:
- type: boolean
- description: Set to false to disable the response-healing plugin for this request. Defaults to true.
+ - and
+ - or
+ type: string
required:
- - id
+ - type
+ - filters
+ type: object
+ ComputerUseServerTool:
+ description: Computer use preview tool configuration
example:
- id: response-healing
- enabled: true
+ display_height: 768
+ display_width: 1024
+ environment: linux
+ type: computer_use_preview
+ properties:
+ display_height:
+ type: integer
+ display_width:
+ type: integer
+ environment:
+ enum:
+ - windows
+ - mac
+ - linux
+ - ubuntu
+ - browser
+ type: string
+ type:
+ enum:
+ - computer_use_preview
+ type: string
+ required:
+ - type
+ - display_height
+ - display_width
+ - environment
+ type: object
+ ConflictResponse:
+ description: Conflict - Resource conflict or concurrent modification
+ example:
+ error:
+ code: 409
+ message: Resource conflict. Please try again later.
+ properties:
+ error:
+ $ref: '#/components/schemas/ConflictResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ ConflictResponseErrorData:
+ description: Error data for ConflictResponse
+ example:
+ code: 409
+ message: Resource conflict. Please try again later.
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ ContentPartAddedEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseContentPartAddedEvent'
+ - properties:
+ part:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/ReasoningTextContent'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
+ type: object
+ description: Event emitted when a new content part is added to an output item
+ example:
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ part:
+ annotations: []
+ text: ''
+ type: output_text
+ sequence_number: 3
+ type: response.content_part.added
+ ContentPartDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseContentPartDoneEvent'
+ - properties:
+ part:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/ReasoningTextContent'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
+ type: object
+ description: Event emitted when a content part is complete
+ example:
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ part:
+ annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ sequence_number: 7
+ type: response.content_part.done
ContextCompressionEngine:
- type: string
+ description: The compression engine to use. Defaults to "middle-out".
enum:
- middle-out
- description: The compression engine to use. Defaults to "middle-out".
example: middle-out
+ type: string
ContextCompressionPlugin:
- type: object
+ example:
+ enabled: true
+ engine: middle-out
+ id: context-compression
properties:
- id:
- type: string
- enum:
- - context-compression
enabled:
- type: boolean
description: Set to false to disable the context-compression plugin for this request. Defaults to true.
+ type: boolean
engine:
$ref: '#/components/schemas/ContextCompressionEngine'
+ id:
+ enum:
+ - context-compression
+ type: string
required:
- id
+ type: object
+ CreatedEvent:
+ description: Event emitted when a response is created
example:
- id: context-compression
- enabled: true
- engine: middle-out
- DeprecatedRoute:
- type: string
- nullable: true
- enum:
- - fallback
- - sort
- - null
- deprecated: true
- description: >-
- **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition.
- Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
- example: fallback
- x-speakeasy-deprecation-message: Use providers.sort.partition instead.
- x-speakeasy-ignore: true
- x-fern-ignore: true
- TraceConfig:
- type: object
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: in_progress
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 0
+ type: response.created
properties:
- trace_id:
- type: string
- trace_name:
- type: string
- span_name:
- type: string
- generation_name:
- type: string
- parent_span_id:
+ response:
+ $ref: '#/components/schemas/BaseResponsesResult'
+ sequence_number:
+ type: integer
+ type:
+ enum:
+ - response.created
type: string
- additionalProperties:
- nullable: true
- example:
- trace_id: trace-abc123
- trace_name: my-app-trace
- description: >-
- Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name,
- parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured
- broadcast destinations.
- ResponsesRequest:
+ required:
+ - type
+ - response
+ - sequence_number
type: object
+ CreateGuardrailRequest:
+ example:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - deepseek
+ description: A guardrail for limiting API usage
+ enforce_zdr: false
+ ignored_providers: null
+ limit_usd: 50
+ name: My New Guardrail
+ reset_interval: monthly
properties:
- input:
- $ref: '#/components/schemas/Inputs'
- instructions:
- type: string
- nullable: true
- metadata:
- $ref: '#/components/schemas/RequestMetadata'
- tools:
- type: array
+ allowed_models:
+ description: Array of model identifiers (slug or canonical_slug accepted)
+ example:
+ - openai/gpt-5.2
+ - anthropic/claude-4.5-opus-20251124
+ - deepseek/deepseek-r1-0528:free
items:
- anyOf:
- - allOf:
- - $ref: '#/components/schemas/FunctionTool'
- - type: object
- properties: {}
- description: Function tool definition
- example:
- type: function
- name: get_weather
- description: Get the current weather in a location
- parameters:
- type: object
- properties:
- location:
- type: string
- description: The city and state
- unit:
- type: string
- enum:
- - celsius
- - fahrenheit
- required:
- - location
- - $ref: '#/components/schemas/Preview_WebSearchServerTool'
- - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool'
- - $ref: '#/components/schemas/Legacy_WebSearchServerTool'
- - $ref: '#/components/schemas/WebSearchServerTool'
- - $ref: '#/components/schemas/FileSearchServerTool'
- - $ref: '#/components/schemas/ComputerUseServerTool'
- - $ref: '#/components/schemas/CodeInterpreterServerTool'
- - $ref: '#/components/schemas/McpServerTool'
- - $ref: '#/components/schemas/ImageGenerationServerTool'
- - $ref: '#/components/schemas/CodexLocalShellTool'
- - $ref: '#/components/schemas/ShellServerTool'
- - $ref: '#/components/schemas/ApplyPatchServerTool'
- - $ref: '#/components/schemas/CustomTool'
- - $ref: '#/components/schemas/DatetimeServerTool'
- - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter'
- tool_choice:
- $ref: '#/components/schemas/OpenAIResponsesToolChoice'
- parallel_tool_calls:
- type: boolean
+ type: string
+ minItems: 1
nullable: true
- model:
- type: string
- models:
type: array
- items:
- type: string
- text:
- $ref: '#/components/schemas/TextExtendedConfig'
- reasoning:
- $ref: '#/components/schemas/ReasoningConfig'
- max_output_tokens:
- type: integer
- temperature:
- type: number
- format: double
- top_p:
- type: number
- format: double
- top_logprobs:
- type: integer
- max_tool_calls:
- type: integer
- presence_penalty:
- type: number
- format: double
- frequency_penalty:
- type: number
- format: double
- top_k:
- type: integer
- image_config:
- type: object
- additionalProperties:
- anyOf:
- - type: string
- - type: number
- format: double
- description: >-
- Provider-specific image configuration options. Keys and values vary by model/provider. See
- https://openrouter.ai/docs/features/multimodal/image-generation for more details.
+ allowed_providers:
+ description: List of allowed provider IDs
example:
- aspect_ratio: '16:9'
- modalities:
- type: array
+ - openai
+ - anthropic
+ - deepseek
items:
- $ref: '#/components/schemas/OutputModalityEnum'
- description: Output modalities for the response. Supported values are "text" and "image".
- example:
- - text
- - image
- prompt_cache_key:
- type: string
- nullable: true
- previous_response_id:
- type: string
+ type: string
+ minItems: 1
nullable: true
- prompt:
- $ref: '#/components/schemas/StoredPromptTemplate'
- include:
type: array
+ description:
+ description: Description of the guardrail
+ example: A guardrail for limiting API usage
+ maxLength: 1000
nullable: true
- items:
- $ref: '#/components/schemas/ResponseIncludesEnum'
- background:
- type: boolean
- nullable: true
- safety_identifier:
type: string
+ enforce_zdr:
+ description: Whether to enforce zero data retention
+ example: false
nullable: true
- store:
type: boolean
- const: false
- default: false
- service_tier:
- type: string
+ ignored_providers:
+ description: List of provider IDs to exclude from routing
+ example:
+ - azure
+ items:
+ type: string
+ minItems: 1
nullable: true
- enum:
- - auto
- - default
- - flex
- - priority
- - scale
- - null
- default: auto
- truncation:
- $ref: '#/components/schemas/OpenAIResponsesTruncation'
- stream:
- type: boolean
- default: false
- provider:
- $ref: '#/components/schemas/ProviderPreferences'
- plugins:
type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/AutoRouterPlugin'
- - $ref: '#/components/schemas/ModerationPlugin'
- - $ref: '#/components/schemas/WebSearchPlugin'
- - $ref: '#/components/schemas/FileParserPlugin'
- - $ref: '#/components/schemas/ResponseHealingPlugin'
- - $ref: '#/components/schemas/ContextCompressionPlugin'
- discriminator:
- propertyName: id
- mapping:
- auto-router: '#/components/schemas/AutoRouterPlugin'
- moderation: '#/components/schemas/ModerationPlugin'
- web: '#/components/schemas/WebSearchPlugin'
- file-parser: '#/components/schemas/FileParserPlugin'
- response-healing: '#/components/schemas/ResponseHealingPlugin'
- context-compression: '#/components/schemas/ContextCompressionPlugin'
- description: Plugins you want to enable for this request, including their settings.
- route:
- $ref: '#/components/schemas/DeprecatedRoute'
- user:
- type: string
- maxLength: 256
- description: >-
- A unique identifier representing your end-user, which helps distinguish between different users of your app.
- This allows your app to identify specific users in case of abuse reports, preventing your entire app from
- being affected by the actions of individual users. Maximum of 256 characters.
- session_id:
+ limit_usd:
+ description: Spending limit in USD
+ example: 50
+ format: double
+ type: number
+ name:
+ description: Name for the new guardrail
+ example: My New Guardrail
+ maxLength: 200
+ minLength: 1
type: string
- maxLength: 256
- description: >-
- A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
- observability. If provided in both the request body and the x-session-id header, the body value takes
- precedence. Maximum of 256 characters.
- trace:
- $ref: '#/components/schemas/TraceConfig'
- description: Request schema for Responses endpoint
- example:
- model: anthropic/claude-4.5-sonnet-20250929
- input:
- - type: message
- content: Hello, how are you?
- role: user
- temperature: 0.7
- top_p: 0.9
- tools:
- - type: function
- name: get_current_weather
- description: Get the current weather in a given location
- parameters:
- type: object
- properties:
- location:
- type: string
- AnthropicContainer:
+ reset_interval:
+ $ref: '#/components/schemas/GuardrailInterval'
+ required:
+ - name
type: object
- nullable: true
+ CreateGuardrailResponse:
+ example:
+ data:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
+ created_at: '2025-08-24T10:30:00Z'
+ description: A guardrail for limiting API usage
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 50
+ name: My New Guardrail
+ reset_interval: monthly
+ updated_at: null
properties:
- id:
- type: string
- expires_at:
- type: string
+ data:
+ allOf:
+ - $ref: '#/components/schemas/Guardrail'
+ - description: The created guardrail
required:
- - id
- - expires_at
- example:
- id: ctr_01abc
- expires_at: '2026-04-08T00:00:00Z'
- AnthropicCitationCharLocation:
+ - data
type: object
+ CustomTool:
+ description: Custom tool configuration
+ example:
+ name: my_tool
+ type: custom
properties:
- type:
- type: string
- enum:
- - char_location
- cited_text:
+ description:
type: string
- document_index:
- type: integer
- document_title:
+ format:
+ anyOf:
+ - properties:
+ type:
+ enum:
+ - text
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ definition:
+ type: string
+ syntax:
+ enum:
+ - lark
+ - regex
+ type: string
+ type:
+ enum:
+ - grammar
+ type: string
+ required:
+ - type
+ - definition
+ - syntax
+ type: object
+ name:
type: string
- nullable: true
- start_char_index:
- type: integer
- end_char_index:
- type: integer
- file_id:
+ type:
+ enum:
+ - custom
type: string
- nullable: true
required:
- type
- - cited_text
- - document_index
- - document_title
- - start_char_index
- - end_char_index
- - file_id
- example:
- type: char_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_char_index: 0
- end_char_index: 18
- file_id: null
- AnthropicCitationPageLocation:
+ - name
type: object
+ DatetimeServerTool:
+ description: 'OpenRouter built-in server tool: returns the current date and time'
+ example:
+ parameters:
+ timezone: America/New_York
+ type: openrouter:datetime
properties:
+ parameters:
+ properties:
+ timezone:
+ description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
+ example: America/New_York
+ type: string
+ type: object
type:
- type: string
enum:
- - page_location
- cited_text:
- type: string
- document_index:
- type: integer
- document_title:
- type: string
- nullable: true
- start_page_number:
- type: integer
- end_page_number:
- type: integer
- file_id:
+ - openrouter:datetime
type: string
- nullable: true
required:
- type
- - cited_text
- - document_index
- - document_title
- - start_page_number
- - end_page_number
- - file_id
- example:
- type: page_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_page_number: 1
- end_page_number: 2
- file_id: null
- AnthropicCitationContentBlockLocation:
type: object
+ DefaultParameters:
+ additionalProperties: false
+ description: Default parameters for this model
+ example:
+ frequency_penalty: 0
+ presence_penalty: 0
+ repetition_penalty: 1
+ temperature: 0.7
+ top_k: 0
+ top_p: 0.9
+ nullable: true
properties:
- type:
- type: string
- enum:
- - content_block_location
- cited_text:
- type: string
- document_index:
- type: integer
- document_title:
- type: string
+ frequency_penalty:
+ format: double
+ type: number
+ presence_penalty:
+ format: double
+ type: number
+ repetition_penalty:
+ format: double
+ type: number
+ temperature:
+ format: double
+ type: number
+ top_k:
+ minimum: 0
nullable: true
- start_block_index:
- type: integer
- end_block_index:
type: integer
- file_id:
- type: string
- nullable: true
- required:
- - type
- - cited_text
- - document_index
- - document_title
- - start_block_index
- - end_block_index
- - file_id
- example:
- type: content_block_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_block_index: 0
- end_block_index: 1
- file_id: null
- AnthropicCitationWebSearchResultLocation:
+ top_p:
+ format: double
+ type: number
type: object
+ DeleteGuardrailResponse:
+ example:
+ deleted: true
properties:
- type:
- type: string
- enum:
- - web_search_result_location
- cited_text:
- type: string
- encrypted_index:
- type: string
- title:
- type: string
- nullable: true
- url:
- type: string
+ deleted:
+ const: true
+ description: Confirmation that the guardrail was deleted
+ example: true
+ type: boolean
required:
- - type
- - cited_text
- - encrypted_index
- - title
- - url
- example:
- type: web_search_result_location
- cited_text: Example cited text
- encrypted_index: enc_idx_0
- title: Example Page
- url: https://example.com
- AnthropicCitationSearchResultLocation:
+ - deleted
type: object
+ DeprecatedRoute:
+ deprecated: true
+ description: >-
+ **DEPRECATED** Use providers.sort.partition instead. Backwards-compatible alias for providers.sort.partition.
+ Accepts legacy values: "fallback" (maps to "model"), "sort" (maps to "none").
+ enum:
+ - fallback
+ - sort
+ - null
+ example: fallback
+ nullable: true
+ type: string
+ x-fern-ignore: true
+ x-speakeasy-deprecation-message: Use providers.sort.partition instead.
+ x-speakeasy-ignore: true
+ EasyInputMessage:
+ example:
+ content: What is the weather today?
+ role: user
properties:
+ content:
+ anyOf:
+ - items:
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - allOf:
+ - $ref: '#/components/schemas/InputImage'
+ - properties: {}
+ type: object
+ description: Image input content item
+ example:
+ detail: auto
+ image_url: https://example.com/image.jpg
+ type: input_image
+ - $ref: '#/components/schemas/InputFile'
+ - $ref: '#/components/schemas/InputAudio'
+ - $ref: '#/components/schemas/InputVideo'
+ type: array
+ - type: string
+ - nullable: true
+ phase:
+ anyOf:
+ - enum:
+ - commentary
+ type: string
+ - enum:
+ - final_answer
+ type: string
+ - nullable: true
+ description: >-
+ The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer`
+ for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve
+ and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
+ example: final_answer
+ role:
+ anyOf:
+ - enum:
+ - user
+ type: string
+ - enum:
+ - system
+ type: string
+ - enum:
+ - assistant
+ type: string
+ - enum:
+ - developer
+ type: string
type:
- type: string
enum:
- - search_result_location
- cited_text:
- type: string
- search_result_index:
- type: integer
- source:
- type: string
- title:
+ - message
type: string
- nullable: true
- start_block_index:
- type: integer
- end_block_index:
- type: integer
required:
- - type
- - cited_text
- - search_result_index
- - source
- - title
- - start_block_index
- - end_block_index
- example:
- type: search_result_location
- cited_text: Example cited text
- search_result_index: 0
- source: example_source
- title: Example Result
- start_block_index: 0
- end_block_index: 1
- AnthropicTextCitation:
- oneOf:
- - $ref: '#/components/schemas/AnthropicCitationCharLocation'
- - $ref: '#/components/schemas/AnthropicCitationPageLocation'
- - $ref: '#/components/schemas/AnthropicCitationContentBlockLocation'
- - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation'
- discriminator:
- propertyName: type
- mapping:
- char_location: '#/components/schemas/AnthropicCitationCharLocation'
- page_location: '#/components/schemas/AnthropicCitationPageLocation'
- content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation'
- web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
- example:
- type: char_location
- cited_text: Example text
- document_index: 0
- document_title: null
- start_char_index: 0
- end_char_index: 10
- file_id: null
- AnthropicTextBlock:
+ - role
type: object
+ EdgeNetworkTimeoutResponse:
+ description: Infrastructure Timeout - Provider request timed out at edge network
+ example:
+ error:
+ code: 524
+ message: Request timed out. Please try again later.
properties:
- type:
- type: string
- enum:
- - text
- text:
- type: string
- citations:
- type: array
+ error:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponseErrorData'
+ user_id:
nullable: true
- items:
- $ref: '#/components/schemas/AnthropicTextCitation'
+ type: string
required:
- - type
- - text
- - citations
- example:
- type: text
- text: Hello, world!
- citations: null
- AnthropicDirectCaller:
+ - error
type: object
+ EdgeNetworkTimeoutResponseErrorData:
+ description: Error data for EdgeNetworkTimeoutResponse
+ example:
+ code: 524
+ message: Request timed out. Please try again later.
properties:
- type:
+ code:
+ type: integer
+ message:
type: string
- enum:
- - direct
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
required:
- - type
- example:
- type: direct
- AnthropicCodeExecution20250825Caller:
+ - code
+ - message
type: object
+ EndpointStatus:
+ enum:
+ - 0
+ - -1
+ - -2
+ - -3
+ - -5
+ - -10
+ example: 0
+ type: integer
+ ErrorEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseErrorEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when an error occurs during streaming
+ example:
+ code: rate_limit_exceeded
+ message: Rate limit exceeded. Please try again later.
+ param: null
+ sequence_number: 2
+ type: error
+ FailedEvent:
+ description: Event emitted when a response has failed
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: failed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 3
+ type: response.failed
properties:
+ response:
+ $ref: '#/components/schemas/BaseResponsesResult'
+ sequence_number:
+ type: integer
type:
- type: string
enum:
- - code_execution_20250825
- tool_id:
+ - response.failed
type: string
required:
- type
- - tool_id
- example:
- type: code_execution_20250825
- tool_id: toolu_01abc
- AnthropicCodeExecution20260120Caller:
+ - response
+ - sequence_number
type: object
+ FileCitation:
+ example:
+ file_id: file-abc123
+ filename: research_paper.pdf
+ index: 0
+ type: file_citation
properties:
- type:
+ file_id:
type: string
- enum:
- - code_execution_20260120
- tool_id:
+ filename:
+ type: string
+ index:
+ type: integer
+ type:
+ enum:
+ - file_citation
type: string
required:
- type
- - tool_id
- example:
- type: code_execution_20260120
- tool_id: toolu_01abc
- AnthropicCaller:
- oneOf:
- - $ref: '#/components/schemas/AnthropicDirectCaller'
- - $ref: '#/components/schemas/AnthropicCodeExecution20250825Caller'
- - $ref: '#/components/schemas/AnthropicCodeExecution20260120Caller'
- discriminator:
- propertyName: type
- mapping:
- direct: '#/components/schemas/AnthropicDirectCaller'
- code_execution_20250825: '#/components/schemas/AnthropicCodeExecution20250825Caller'
- code_execution_20260120: '#/components/schemas/AnthropicCodeExecution20260120Caller'
- example:
- type: direct
- AnthropicToolUseBlock:
+ - file_id
+ - filename
+ - index
type: object
+ FileParserPlugin:
+ example:
+ enabled: true
+ id: file-parser
+ pdf:
+ engine: cloudflare-ai
properties:
- type:
- type: string
- enum:
- - tool_use
+ enabled:
+ description: Set to false to disable the file-parser plugin for this request. Defaults to true.
+ type: boolean
id:
+ enum:
+ - file-parser
type: string
- caller:
- $ref: '#/components/schemas/AnthropicCaller'
- name:
- type: string
- input:
- nullable: true
+ pdf:
+ $ref: '#/components/schemas/PDFParserOptions'
required:
- - type
- id
- - caller
- - name
- example:
- type: tool_use
- id: toolu_01abc
- caller:
- type: direct
- name: get_weather
- input:
- location: San Francisco
- AnthropicThinkingBlock:
type: object
+ FilePath:
+ example:
+ file_id: file-xyz789
+ index: 0
+ type: file_path
properties:
- type:
+ file_id:
type: string
+ index:
+ type: integer
+ type:
enum:
- - thinking
- thinking:
- type: string
- signature:
+ - file_path
type: string
required:
- type
- - thinking
- - signature
- example:
- type: thinking
- thinking: Let me think about this...
- signature: sig_abc123
- AnthropicRedactedThinkingBlock:
+ - file_id
+ - index
type: object
+ FileSearchServerTool:
+ description: File search tool configuration
+ example:
+ type: file_search
+ vector_store_ids:
+ - vs_abc123
properties:
+ filters:
+ anyOf:
+ - properties:
+ key:
+ type: string
+ type:
+ enum:
+ - eq
+ - ne
+ - gt
+ - gte
+ - lt
+ - lte
+ type: string
+ value:
+ anyOf:
+ - type: string
+ - format: double
+ type: number
+ - type: boolean
+ - items:
+ anyOf:
+ - type: string
+ - format: double
+ type: number
+ type: array
+ required:
+ - key
+ - type
+ - value
+ type: object
+ - $ref: '#/components/schemas/CompoundFilter'
+ - nullable: true
+ max_num_results:
+ type: integer
+ ranking_options:
+ properties:
+ ranker:
+ enum:
+ - auto
+ - default-2024-11-15
+ type: string
+ score_threshold:
+ format: double
+ type: number
+ type: object
type:
- type: string
enum:
- - redacted_thinking
- data:
+ - file_search
type: string
+ vector_store_ids:
+ items:
+ type: string
+ type: array
required:
- type
- - data
- example:
- type: redacted_thinking
- data: cmVkYWN0ZWQ=
- AnthropicServerToolName:
- type: string
- enum:
- - web_search
- - web_fetch
- - code_execution
- - bash_code_execution
- - text_editor_code_execution
- - tool_search_tool_regex
- - tool_search_tool_bm25
- example: web_search
- AnthropicServerToolUseBlock:
+ - vector_store_ids
type: object
+ ForbiddenResponse:
+ description: Forbidden - Authentication successful but insufficient permissions
+ example:
+ error:
+ code: 403
+ message: Only management keys can perform this operation
properties:
- type:
- type: string
- enum:
- - server_tool_use
- id:
- type: string
- caller:
- $ref: '#/components/schemas/AnthropicCaller'
- name:
- $ref: '#/components/schemas/AnthropicServerToolName'
- input:
+ error:
+ $ref: '#/components/schemas/ForbiddenResponseErrorData'
+ user_id:
nullable: true
+ type: string
required:
- - type
- - id
- - caller
- - name
- example:
- type: server_tool_use
- id: srvtoolu_01abc
- caller:
- type: direct
- name: web_search
- input:
- query: latest news
- AnthropicWebSearchResult:
+ - error
type: object
+ ForbiddenResponseErrorData:
+ description: Error data for ForbiddenResponse
+ example:
+ code: 403
+ message: Only management keys can perform this operation
properties:
- type:
- type: string
- enum:
- - web_search_result
- encrypted_content:
- type: string
- page_age:
+ code:
+ type: integer
+ message:
type: string
+ metadata:
+ additionalProperties:
+ nullable: true
nullable: true
- title:
- type: string
- url:
- type: string
+ type: object
required:
- - type
- - encrypted_content
- - page_age
- - title
- - url
- example:
- type: web_search_result
- encrypted_content: enc_content_0
- page_age: null
- title: Example Page
- url: https://example.com
- AnthropicWebSearchToolResultError:
+ - code
+ - message
type: object
+ FormatJsonObjectConfig:
+ description: JSON object response format
+ example:
+ type: json_object
properties:
type:
- type: string
enum:
- - web_search_tool_result_error
- error_code:
+ - json_object
type: string
- enum:
- - invalid_tool_input
- - unavailable
- - max_uses_exceeded
- - too_many_requests
- - query_too_long
- - request_too_large
required:
- type
- - error_code
- example:
- type: web_search_tool_result_error
- error_code: unavailable
- AnthropicWebSearchToolResult:
type: object
- properties:
- type:
- type: string
- enum:
- - web_search_tool_result
- caller:
- $ref: '#/components/schemas/AnthropicCaller'
- tool_use_id:
- type: string
- content:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/AnthropicWebSearchResult'
- - $ref: '#/components/schemas/AnthropicWebSearchToolResultError'
- required:
- - type
- - caller
- - tool_use_id
- - content
+ FormatJsonSchemaConfig:
+ description: JSON schema constrained response format
example:
- type: web_search_tool_result
- caller:
- type: direct
- tool_use_id: srvtoolu_01abc
- content: []
- AnthropicWebFetchToolResultError:
- type: object
+ description: User information schema
+ name: user_info
+ schema:
+ properties:
+ age:
+ type: number
+ name:
+ type: string
+ required:
+ - name
+ type: object
+ type: json_schema
properties:
- type:
+ description:
type: string
- enum:
- - web_fetch_tool_result_error
- error_code:
+ name:
type: string
- enum:
- - invalid_tool_input
- - url_too_long
- - url_not_allowed
- - url_not_accessible
- - unsupported_content_type
- - too_many_requests
- - max_uses_exceeded
- - unavailable
- required:
- - type
- - error_code
- example:
- type: web_fetch_tool_result_error
- error_code: unavailable
- AnthropicCitationsConfig:
- type: object
- nullable: true
- properties:
- enabled:
+ schema:
+ additionalProperties:
+ nullable: true
+ type: object
+ strict:
+ nullable: true
type: boolean
- required:
- - enabled
- example:
- enabled: true
- AnthropicBase64PdfSource:
- type: object
- properties:
type:
- type: string
- enum:
- - base64
- media_type:
- type: string
enum:
- - application/pdf
- data:
+ - json_schema
type: string
required:
- type
- - media_type
- - data
- example:
- type: base64
- media_type: application/pdf
- data: JVBERi0x...
- AnthropicPlainTextSource:
+ - name
+ - schema
type: object
+ Formats:
+ anyOf:
+ - $ref: '#/components/schemas/FormatTextConfig'
+ - $ref: '#/components/schemas/FormatJsonObjectConfig'
+ - $ref: '#/components/schemas/FormatJsonSchemaConfig'
+ description: Text response format configuration
+ example:
+ type: text
+ FormatTextConfig:
+ description: Plain text response format
+ example:
+ type: text
properties:
type:
- type: string
enum:
- text
- media_type:
- type: string
- enum:
- - text/plain
- data:
type: string
required:
- type
- - media_type
- - data
- example:
- type: text
- media_type: text/plain
- data: Hello, world!
- AnthropicDocumentBlock:
type: object
+ FunctionCallArgsDeltaEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseFunctionCallArgsDeltaEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when function call arguments are being streamed
+ example:
+ delta: '{"city": "..."}'
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ type: response.function_call_arguments.delta
+ FunctionCallArgsDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseFunctionCallArgsDoneEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when function call arguments streaming is complete
+ example:
+ arguments: '{"city": "San Francisco", "units": "celsius"}'
+ item_id: item-1
+ name: get_weather
+ output_index: 0
+ sequence_number: 6
+ type: response.function_call_arguments.done
+ FunctionCallItem:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponseFunctionToolCall'
+ - properties: {}
+ required:
+ - id
+ type: object
+ description: A function call initiated by the model
+ example:
+ arguments: '{"location":"San Francisco"}'
+ call_id: call-abc123
+ id: call-abc123
+ name: get_weather
+ status: completed
+ type: function_call
+ FunctionCallOutputItem:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponseFunctionToolCallOutput'
+ - properties:
+ output:
+ anyOf:
+ - type: string
+ - items:
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - allOf:
+ - $ref: '#/components/schemas/InputImage'
+ - properties: {}
+ type: object
+ description: Image input content item
+ example:
+ detail: auto
+ image_url: https://example.com/image.jpg
+ type: input_image
+ - $ref: '#/components/schemas/InputFile'
+ type: array
+ type: object
+ description: The output from a function call execution
+ example:
+ call_id: call-abc123
+ id: output-abc123
+ output: '{"temperature":72,"conditions":"sunny"}'
+ status: completed
+ type: function_call_output
+ FunctionTool:
+ description: Function tool definition
+ example:
+ description: Get the current weather in a location
+ name: get_weather
+ parameters:
+ properties:
+ location:
+ description: The city and state
+ type: string
+ unit:
+ enum:
+ - celsius
+ - fahrenheit
+ type: string
+ required:
+ - location
+ type: object
+ type: function
properties:
- citations:
- $ref: '#/components/schemas/AnthropicCitationsConfig'
- source:
- anyOf:
- - $ref: '#/components/schemas/AnthropicBase64PdfSource'
- - $ref: '#/components/schemas/AnthropicPlainTextSource'
- title:
- type: string
+ description:
nullable: true
- type:
type: string
- enum:
- - document
- required:
- - citations
- - source
- - title
- - type
- example:
- citations: null
- source:
- data: Hello, world!
- media_type: text/plain
- type: text
- title: null
- type: document
- AnthropicWebFetchBlock:
- type: object
- properties:
- content:
- $ref: '#/components/schemas/AnthropicDocumentBlock'
- retrieved_at:
+ name:
type: string
+ parameters:
+ additionalProperties:
+ nullable: true
nullable: true
+ type: object
+ strict:
+ nullable: true
+ type: boolean
type:
- type: string
enum:
- - web_fetch_result
- url:
+ - function
type: string
required:
- - content
- - retrieved_at
- type
- - url
+ - name
+ - parameters
+ type: object
+ GetGuardrailResponse:
example:
- content:
- type: document
- citations: null
- source:
- data: ''
- media_type: text/plain
- type: text
- title: null
- retrieved_at: null
- type: web_fetch_result
- url: https://example.com
- AnthropicWebFetchContent:
- oneOf:
- - $ref: '#/components/schemas/AnthropicWebFetchToolResultError'
- - $ref: '#/components/schemas/AnthropicWebFetchBlock'
- discriminator:
- propertyName: type
- mapping:
- web_fetch_tool_result_error: '#/components/schemas/AnthropicWebFetchToolResultError'
- web_fetch_result: '#/components/schemas/AnthropicWebFetchBlock'
- example:
- type: web_fetch_result
- content:
- type: document
- citations: null
- source:
- data: ''
- media_type: text/plain
- type: text
- title: null
- retrieved_at: null
- url: https://example.com
- AnthropicWebFetchToolResult:
- type: object
+ data:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
+ created_at: '2025-08-24T10:30:00Z'
+ description: Guardrail for production environment
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 100
+ name: Production Guardrail
+ reset_interval: monthly
+ updated_at: '2025-08-24T15:45:00Z'
properties:
- type:
- type: string
- enum:
- - web_fetch_tool_result
- caller:
- $ref: '#/components/schemas/AnthropicCaller'
- content:
- $ref: '#/components/schemas/AnthropicWebFetchContent'
- tool_use_id:
- type: string
+ data:
+ allOf:
+ - $ref: '#/components/schemas/Guardrail'
+ - description: The guardrail
required:
- - type
- - caller
- - content
- - tool_use_id
- example:
- type: web_fetch_tool_result
- caller:
- type: direct
- content:
- type: web_fetch_result
- content:
- type: document
- citations: null
- source:
- data: ''
- media_type: text/plain
- type: text
- title: null
- retrieved_at: null
- url: https://example.com
- tool_use_id: srvtoolu_01abc
- AnthropicServerToolErrorCode:
- type: string
- enum:
- - invalid_tool_input
- - unavailable
- - too_many_requests
- - execution_time_exceeded
- example: unavailable
- AnthropicCodeExecutionToolResultError:
+ - data
type: object
+ GoneResponse:
+ description: Gone - Endpoint has been permanently removed or deprecated
+ example:
+ error:
+ code: 410
+ message: >-
+ The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been
+ removed. Use the web credits purchase flow instead.
properties:
- error_code:
- $ref: '#/components/schemas/AnthropicServerToolErrorCode'
- type:
+ error:
+ $ref: '#/components/schemas/GoneResponseErrorData'
+ user_id:
+ nullable: true
type: string
- enum:
- - code_execution_tool_result_error
required:
- - error_code
- - type
- example:
- error_code: unavailable
- type: code_execution_tool_result_error
- AnthropicCodeExecutionOutput:
+ - error
type: object
+ GoneResponseErrorData:
+ description: Error data for GoneResponse
+ example:
+ code: 410
+ message: >-
+ The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been
+ removed. Use the web credits purchase flow instead.
properties:
- file_id:
- type: string
- type:
+ code:
+ type: integer
+ message:
type: string
- enum:
- - code_execution_output
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
required:
- - file_id
- - type
- example:
- file_id: file_01abc
- type: code_execution_output
- AnthropicCodeExecutionResult:
+ - code
+ - message
type: object
+ Guardrail:
+ example:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
+ created_at: '2025-08-24T10:30:00Z'
+ description: Guardrail for production environment
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 100
+ name: Production Guardrail
+ reset_interval: monthly
+ updated_at: '2025-08-24T15:45:00Z'
properties:
- content:
+ allowed_models:
+ description: Array of model canonical_slugs (immutable identifiers)
+ example:
+ - openai/gpt-5.2-20251211
+ - anthropic/claude-4.5-opus-20251124
+ - deepseek/deepseek-r1-0528:free
+ items:
+ type: string
+ nullable: true
type: array
+ allowed_providers:
+ description: List of allowed provider IDs
+ example:
+ - openai
+ - anthropic
+ - google
items:
- $ref: '#/components/schemas/AnthropicCodeExecutionOutput'
- return_code:
- type: integer
- stderr:
+ type: string
+ nullable: true
+ type: array
+ created_at:
+ description: ISO 8601 timestamp of when the guardrail was created
+ example: '2025-08-24T10:30:00Z'
type: string
- stdout:
+ description:
+ description: Description of the guardrail
+ example: Guardrail for production environment
+ nullable: true
type: string
- type:
+ enforce_zdr:
+ description: Whether to enforce zero data retention
+ example: false
+ nullable: true
+ type: boolean
+ id:
+ description: Unique identifier for the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
type: string
- enum:
- - code_execution_result
- required:
- - content
- - return_code
- - stderr
- - stdout
- - type
- example:
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- type: code_execution_result
- AnthropicEncryptedCodeExecutionResult:
- type: object
- properties:
- content:
- type: array
+ ignored_providers:
+ description: List of provider IDs to exclude from routing
+ example:
+ - azure
items:
- $ref: '#/components/schemas/AnthropicCodeExecutionOutput'
- encrypted_stdout:
- type: string
- return_code:
- type: integer
- stderr:
+ type: string
+ nullable: true
+ type: array
+ limit_usd:
+ description: Spending limit in USD
+ example: 100
+ format: double
+ type: number
+ name:
+ description: Name of the guardrail
+ example: Production Guardrail
type: string
- type:
+ reset_interval:
+ $ref: '#/components/schemas/GuardrailInterval'
+ updated_at:
+ description: ISO 8601 timestamp of when the guardrail was last updated
+ example: '2025-08-24T15:45:00Z'
+ nullable: true
type: string
- enum:
- - encrypted_code_execution_result
required:
- - content
- - encrypted_stdout
- - return_code
- - stderr
- - type
- example:
- content: []
- encrypted_stdout: enc_stdout
- return_code: 0
- stderr: ''
- type: encrypted_code_execution_result
- AnthropicCodeExecutionContent:
- oneOf:
- - $ref: '#/components/schemas/AnthropicCodeExecutionToolResultError'
- - $ref: '#/components/schemas/AnthropicCodeExecutionResult'
- - $ref: '#/components/schemas/AnthropicEncryptedCodeExecutionResult'
- discriminator:
- propertyName: type
- mapping:
- code_execution_tool_result_error: '#/components/schemas/AnthropicCodeExecutionToolResultError'
- code_execution_result: '#/components/schemas/AnthropicCodeExecutionResult'
- encrypted_code_execution_result: '#/components/schemas/AnthropicEncryptedCodeExecutionResult'
- example:
- type: code_execution_result
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- AnthropicCodeExecutionToolResult:
+ - id
+ - name
+ - created_at
type: object
+ GuardrailInterval:
+ description: Interval at which the limit resets (daily, weekly, monthly)
+ enum:
+ - daily
+ - weekly
+ - monthly
+ - null
+ example: monthly
+ nullable: true
+ type: string
+ ImageGenCallCompletedEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted'
+ - properties: {}
+ type: object
+ description: Image generation call completed
+ example:
+ item_id: call-123
+ output_index: 0
+ sequence_number: 4
+ type: response.image_generation_call.completed
+ ImageGenCallGeneratingEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesImageGenCallGenerating'
+ - properties: {}
+ type: object
+ description: Image generation call is generating
+ example:
+ item_id: call-123
+ output_index: 0
+ sequence_number: 2
+ type: response.image_generation_call.generating
+ ImageGenCallInProgressEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesImageGenCallInProgress'
+ - properties: {}
+ type: object
+ description: Image generation call in progress
+ example:
+ item_id: call-123
+ output_index: 0
+ sequence_number: 1
+ type: response.image_generation_call.in_progress
+ ImageGenCallPartialImageEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesImageGenCallPartialImage'
+ - properties: {}
+ type: object
+ description: Image generation call with partial image
+ example:
+ item_id: call-123
+ output_index: 0
+ partial_image_b64: base64encodedimage...
+ partial_image_index: 0
+ sequence_number: 3
+ type: response.image_generation_call.partial_image
+ ImageGenerationServerTool:
+ description: Image generation tool configuration
+ example:
+ quality: high
+ type: image_generation
properties:
- type:
+ background:
+ enum:
+ - transparent
+ - opaque
+ - auto
type: string
+ input_fidelity:
enum:
- - code_execution_tool_result
- content:
- $ref: '#/components/schemas/AnthropicCodeExecutionContent'
- tool_use_id:
+ - high
+ - low
+ - null
+ nullable: true
type: string
- required:
- - type
- - content
- - tool_use_id
- example:
- type: code_execution_tool_result
- content:
- type: code_execution_result
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- tool_use_id: srvtoolu_01abc
- AnthropicBashCodeExecutionToolResultError:
- type: object
- properties:
- error_code:
+ input_image_mask:
+ properties:
+ file_id:
+ type: string
+ image_url:
+ type: string
+ type: object
+ model:
+ enum:
+ - gpt-image-1
+ - gpt-image-1-mini
type: string
+ moderation:
enum:
- - invalid_tool_input
- - unavailable
- - too_many_requests
- - execution_time_exceeded
- - output_file_too_large
- type:
+ - auto
+ - low
type: string
+ output_compression:
+ type: integer
+ output_format:
enum:
- - bash_code_execution_tool_result_error
+ - png
+ - webp
+ - jpeg
+ type: string
+ partial_images:
+ type: integer
+ quality:
+ enum:
+ - low
+ - medium
+ - high
+ - auto
+ type: string
+ size:
+ enum:
+ - 1024x1024
+ - 1024x1536
+ - 1536x1024
+ - auto
+ type: string
+ type:
+ enum:
+ - image_generation
+ type: string
required:
- - error_code
- type
- example:
- error_code: unavailable
- type: bash_code_execution_tool_result_error
- AnthropicBashCodeExecutionOutput:
type: object
+ ImageGenerationStatus:
+ enum:
+ - in_progress
+ - completed
+ - generating
+ - failed
+ example: completed
+ type: string
+ IncompleteDetails:
+ example:
+ reason: max_output_tokens
+ nullable: true
properties:
- file_id:
+ reason:
+ enum:
+ - max_output_tokens
+ - content_filter
type: string
+ type: object
+ IncompleteEvent:
+ description: Event emitted when a response is incomplete
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: incomplete
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 5
+ type: response.incomplete
+ properties:
+ response:
+ $ref: '#/components/schemas/BaseResponsesResult'
+ sequence_number:
+ type: integer
type:
- type: string
enum:
- - bash_code_execution_output
+ - response.incomplete
+ type: string
required:
- - file_id
- type
- example:
- file_id: file_01abc
- type: bash_code_execution_output
- AnthropicBashCodeExecutionResult:
+ - response
+ - sequence_number
type: object
+ InProgressEvent:
+ description: Event emitted when a response is in progress
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: in_progress
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 1
+ type: response.in_progress
properties:
- content:
- type: array
- items:
- $ref: '#/components/schemas/AnthropicBashCodeExecutionOutput'
- return_code:
+ response:
+ $ref: '#/components/schemas/BaseResponsesResult'
+ sequence_number:
type: integer
- stderr:
- type: string
- stdout:
- type: string
type:
- type: string
enum:
- - bash_code_execution_result
+ - response.in_progress
+ type: string
required:
- - content
- - return_code
- - stderr
- - stdout
- type
- example:
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- type: bash_code_execution_result
- AnthropicBashCodeExecutionContent:
- oneOf:
- - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResultError'
- - $ref: '#/components/schemas/AnthropicBashCodeExecutionResult'
- discriminator:
- propertyName: type
- mapping:
- bash_code_execution_tool_result_error: '#/components/schemas/AnthropicBashCodeExecutionToolResultError'
- bash_code_execution_result: '#/components/schemas/AnthropicBashCodeExecutionResult'
- example:
- type: bash_code_execution_result
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- AnthropicBashCodeExecutionToolResult:
+ - response
+ - sequence_number
type: object
+ InputAudio:
+ description: Audio input content item
+ example:
+ input_audio:
+ data: SGVsbG8gV29ybGQ=
+ format: mp3
+ type: input_audio
properties:
+ input_audio:
+ properties:
+ data:
+ type: string
+ format:
+ enum:
+ - mp3
+ - wav
+ type: string
+ required:
+ - data
+ - format
+ type: object
type:
- type: string
enum:
- - bash_code_execution_tool_result
- content:
- $ref: '#/components/schemas/AnthropicBashCodeExecutionContent'
- tool_use_id:
+ - input_audio
type: string
required:
- type
- - content
- - tool_use_id
- example:
- type: bash_code_execution_tool_result
- content:
- type: bash_code_execution_result
- content: []
- return_code: 0
- stderr: ''
- stdout: Hello
- tool_use_id: srvtoolu_01abc
- AnthropicTextEditorCodeExecutionToolResultError:
+ - input_audio
type: object
+ InputFile:
+ description: File input content item
+ example:
+ file_id: file-abc123
+ filename: document.pdf
+ type: input_file
properties:
- error_code:
- type: string
- enum:
- - invalid_tool_input
- - unavailable
- - too_many_requests
- - execution_time_exceeded
- - file_not_found
- error_message:
+ file_data:
type: string
+ file_id:
nullable: true
- type:
type: string
- enum:
- - text_editor_code_execution_tool_result_error
- required:
- - error_code
- - error_message
- - type
- example:
- error_code: unavailable
- error_message: null
- type: text_editor_code_execution_tool_result_error
- AnthropicTextEditorCodeExecutionViewResult:
- type: object
- properties:
- content:
+ file_url:
type: string
- file_type:
+ filename:
type: string
- enum:
- - text
- - image
- - pdf
- num_lines:
- type: integer
- start_line:
- type: integer
- total_lines:
- type: integer
type:
- type: string
enum:
- - text_editor_code_execution_view_result
- required:
- - content
- - file_type
- - num_lines
- - start_line
- - total_lines
- - type
- example:
- content: file content
- file_type: text
- num_lines: 10
- start_line: 1
- total_lines: 10
- type: text_editor_code_execution_view_result
- AnthropicTextEditorCodeExecutionCreateResult:
- type: object
- properties:
- is_file_update:
- type: boolean
- type:
+ - input_file
type: string
- enum:
- - text_editor_code_execution_create_result
required:
- - is_file_update
- type
- example:
- is_file_update: false
- type: text_editor_code_execution_create_result
- AnthropicTextEditorCodeExecutionStrReplaceResult:
type: object
+ InputImage:
+ description: Image input content item
+ example:
+ detail: auto
+ image_url: https://example.com/image.jpg
+ type: input_image
properties:
- lines:
- type: array
+ detail:
+ enum:
+ - auto
+ - high
+ - low
+ type: string
+ image_url:
nullable: true
- items:
- type: string
- new_lines:
- type: integer
- new_start:
- type: integer
- old_lines:
- type: integer
- old_start:
- type: integer
- type:
type: string
- enum:
- - text_editor_code_execution_str_replace_result
- required:
- - lines
- - new_lines
- - new_start
- - old_lines
- - old_start
- - type
- example:
- lines: null
- new_lines: null
- new_start: null
- old_lines: null
- old_start: null
- type: text_editor_code_execution_str_replace_result
- AnthropicTextEditorCodeExecutionContent:
- oneOf:
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResultError'
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionViewResult'
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionCreateResult'
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionStrReplaceResult'
- discriminator:
- propertyName: type
- mapping:
- text_editor_code_execution_tool_result_error: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResultError'
- text_editor_code_execution_view_result: '#/components/schemas/AnthropicTextEditorCodeExecutionViewResult'
- text_editor_code_execution_create_result: '#/components/schemas/AnthropicTextEditorCodeExecutionCreateResult'
- text_editor_code_execution_str_replace_result: '#/components/schemas/AnthropicTextEditorCodeExecutionStrReplaceResult'
- example:
- type: text_editor_code_execution_view_result
- content: file content
- file_type: text
- num_lines: 10
- start_line: 1
- total_lines: 10
- AnthropicTextEditorCodeExecutionToolResult:
- type: object
- properties:
type:
- type: string
enum:
- - text_editor_code_execution_tool_result
- content:
- $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionContent'
- tool_use_id:
+ - input_image
type: string
required:
- type
- - content
- - tool_use_id
+ - detail
+ type: object
+ InputMessageItem:
example:
- type: text_editor_code_execution_tool_result
content:
- type: text_editor_code_execution_view_result
- content: file content
- file_type: text
- num_lines: 10
- start_line: 1
- total_lines: 10
- tool_use_id: srvtoolu_01abc
- AnthropicToolSearchResultError:
- type: object
+ - text: Hello, how are you?
+ type: input_text
+ id: msg-abc123
+ role: user
+ type: message
properties:
- error_code:
- $ref: '#/components/schemas/AnthropicServerToolErrorCode'
- error_message:
- type: string
+ content:
+ items:
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - allOf:
+ - $ref: '#/components/schemas/InputImage'
+ - properties: {}
+ type: object
+ description: Image input content item
+ example:
+ detail: auto
+ image_url: https://example.com/image.jpg
+ type: input_image
+ - $ref: '#/components/schemas/InputFile'
+ - $ref: '#/components/schemas/InputAudio'
+ - $ref: '#/components/schemas/InputVideo'
nullable: true
- type:
- type: string
- enum:
- - tool_search_tool_result_error
- required:
- - error_code
- - error_message
- - type
- example:
- error_code: unavailable
- error_message: null
- type: tool_search_tool_result_error
- AnthropicToolReference:
- type: object
- properties:
- tool_name:
+ type: array
+ id:
type: string
+ role:
+ anyOf:
+ - enum:
+ - user
+ type: string
+ - enum:
+ - system
+ type: string
+ - enum:
+ - developer
+ type: string
type:
- type: string
enum:
- - tool_reference
+ - message
+ type: string
required:
- - tool_name
- - type
- example:
- tool_name: my_tool
- type: tool_reference
- AnthropicToolSearchResult:
+ - role
type: object
- properties:
- tool_references:
+ InputModality:
+ enum:
+ - text
+ - image
+ - file
+ - audio
+ - video
+ example: text
+ type: string
+ Inputs:
+ anyOf:
+ - type: string
+ - items:
+ anyOf:
+ - $ref: '#/components/schemas/ReasoningItem'
+ - $ref: '#/components/schemas/EasyInputMessage'
+ - $ref: '#/components/schemas/InputMessageItem'
+ - $ref: '#/components/schemas/FunctionCallItem'
+ - $ref: '#/components/schemas/FunctionCallOutputItem'
+ - allOf:
+ - $ref: '#/components/schemas/OutputMessageItem'
+ - properties:
+ content:
+ anyOf:
+ - items:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
+ type: array
+ - type: string
+ - nullable: true
+ type: object
+ description: An output message item
+ example:
+ content:
+ - annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ id: msg-123
+ role: assistant
+ status: completed
+ type: message
+ - allOf:
+ - $ref: '#/components/schemas/OutputReasoningItem'
+ - properties:
+ summary:
+ items:
+ $ref: '#/components/schemas/ReasoningSummaryText'
+ nullable: true
+ type: array
+ type: object
+ description: An output item containing reasoning
+ example:
+ content:
+ - text: First, we analyze the problem...
+ type: reasoning_text
+ format: anthropic-claude-v1
+ id: reasoning-123
+ signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
+ status: completed
+ summary:
+ - text: Analyzed the problem and found the optimal solution.
+ type: summary_text
+ type: reasoning
+ - $ref: '#/components/schemas/OutputFunctionCallItem'
+ - $ref: '#/components/schemas/OutputWebSearchCallItem'
+ - $ref: '#/components/schemas/OutputFileSearchCallItem'
+ - $ref: '#/components/schemas/OutputImageGenerationCallItem'
+ - $ref: '#/components/schemas/OutputDatetimeItem'
+ - $ref: '#/components/schemas/OutputWebSearchServerToolItem'
type: array
- items:
- $ref: '#/components/schemas/AnthropicToolReference'
- type:
- type: string
- enum:
- - tool_search_tool_search_result
- required:
- - tool_references
- - type
+ description: Input for a response request - can be a string or array of items
example:
- tool_references:
- - tool_name: my_tool
- type: tool_reference
- type: tool_search_tool_search_result
- AnthropicToolSearchContent:
- oneOf:
- - $ref: '#/components/schemas/AnthropicToolSearchResultError'
- - $ref: '#/components/schemas/AnthropicToolSearchResult'
- discriminator:
- propertyName: type
- mapping:
- tool_search_tool_result_error: '#/components/schemas/AnthropicToolSearchResultError'
- tool_search_tool_search_result: '#/components/schemas/AnthropicToolSearchResult'
+ - content: What is the weather today?
+ role: user
+ InputText:
+ description: Text input content item
example:
- type: tool_search_tool_search_result
- tool_references:
- - tool_name: my_tool
- type: tool_reference
- AnthropicToolSearchToolResult:
- type: object
+ text: Hello, how can I help you?
+ type: input_text
properties:
- type:
+ text:
type: string
+ type:
enum:
- - tool_search_tool_result
- content:
- $ref: '#/components/schemas/AnthropicToolSearchContent'
- tool_use_id:
+ - input_text
type: string
required:
- type
- - content
- - tool_use_id
- example:
- type: tool_search_tool_result
- content:
- type: tool_search_tool_search_result
- tool_references:
- - tool_name: my_tool
- type: tool_reference
- tool_use_id: srvtoolu_01abc
- AnthropicContainerUpload:
+ - text
type: object
+ InputVideo:
+ description: Video input content item
+ example:
+ type: input_video
+ video_url: https://example.com/video.mp4
properties:
type:
- type: string
enum:
- - container_upload
- file_id:
+ - input_video
+ type: string
+ video_url:
+ description: A base64 data URL or remote URL that resolves to a video file
type: string
required:
- type
- - file_id
- example:
- type: container_upload
- file_id: file_01abc
- AnthropicCompactionBlock:
+ - video_url
type: object
+ InstructType:
+ description: Instruction format type
+ enum:
+ - none
+ - airoboros
+ - alpaca
+ - alpaca-modif
+ - chatml
+ - claude
+ - code-llama
+ - gemma
+ - llama2
+ - llama3
+ - mistral
+ - nemotron
+ - neural
+ - openchat
+ - phi3
+ - rwkv
+ - vicuna
+ - zephyr
+ - deepseek-r1
+ - deepseek-v3.1
+ - qwq
+ - qwen3
+ - null
+ example: chatml
+ nullable: true
+ type: string
+ InternalServerResponse:
+ description: Internal Server Error - Unexpected server error
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
properties:
- type:
+ error:
+ $ref: '#/components/schemas/InternalServerResponseErrorData'
+ user_id:
+ nullable: true
type: string
- enum:
- - compaction
- content:
+ required:
+ - error
+ type: object
+ InternalServerResponseErrorData:
+ description: Error data for InternalServerResponse
+ example:
+ code: 500
+ message: Internal Server Error
+ properties:
+ code:
+ type: integer
+ message:
type: string
+ metadata:
+ additionalProperties:
+ nullable: true
nullable: true
+ type: object
required:
- - type
- - content
+ - code
+ - message
+ type: object
+ KeyAssignment:
example:
- type: compaction
- content: Compacted summary of conversation.
- ORAnthropicContentBlock:
- oneOf:
- - $ref: '#/components/schemas/AnthropicTextBlock'
- - $ref: '#/components/schemas/AnthropicToolUseBlock'
- - $ref: '#/components/schemas/AnthropicThinkingBlock'
- - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock'
- - $ref: '#/components/schemas/AnthropicServerToolUseBlock'
- - $ref: '#/components/schemas/AnthropicWebSearchToolResult'
- - $ref: '#/components/schemas/AnthropicWebFetchToolResult'
- - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicToolSearchToolResult'
- - $ref: '#/components/schemas/AnthropicContainerUpload'
- - $ref: '#/components/schemas/AnthropicCompactionBlock'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/AnthropicTextBlock'
- tool_use: '#/components/schemas/AnthropicToolUseBlock'
- thinking: '#/components/schemas/AnthropicThinkingBlock'
- redacted_thinking: '#/components/schemas/AnthropicRedactedThinkingBlock'
- server_tool_use: '#/components/schemas/AnthropicServerToolUseBlock'
- web_search_tool_result: '#/components/schemas/AnthropicWebSearchToolResult'
- web_fetch_tool_result: '#/components/schemas/AnthropicWebFetchToolResult'
- code_execution_tool_result: '#/components/schemas/AnthropicCodeExecutionToolResult'
- bash_code_execution_tool_result: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
- text_editor_code_execution_tool_result: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
- tool_search_tool_result: '#/components/schemas/AnthropicToolSearchToolResult'
- container_upload: '#/components/schemas/AnthropicContainerUpload'
- compaction: '#/components/schemas/AnthropicCompactionBlock'
- example:
- type: text
- text: Hello, world!
- citations: null
- ORAnthropicStopReason:
- type: string
- nullable: true
- enum:
- - end_turn
- - max_tokens
- - stop_sequence
- - tool_use
- - pause_turn
- - refusal
- - compaction
- - null
- example: end_turn
- AnthropicCacheCreation:
- type: object
- nullable: true
+ assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ key_label: prod-key
+ key_name: Production Key
properties:
- ephemeral_5m_input_tokens:
- type: integer
- ephemeral_1h_input_tokens:
- type: integer
+ assigned_by:
+ description: User ID of who made the assignment
+ example: user_abc123
+ nullable: true
+ type: string
+ created_at:
+ description: ISO 8601 timestamp of when the assignment was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ guardrail_id:
+ description: ID of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440001
+ format: uuid
+ type: string
+ id:
+ description: Unique identifier for the assignment
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ key_hash:
+ description: Hash of the assigned API key
+ example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ type: string
+ key_label:
+ description: Label of the API key
+ example: prod-key
+ type: string
+ key_name:
+ description: Name of the API key
+ example: Production Key
+ type: string
required:
- - ephemeral_5m_input_tokens
- - ephemeral_1h_input_tokens
- example:
- ephemeral_5m_input_tokens: 100
- ephemeral_1h_input_tokens: 0
- AnthropicServerToolUsage:
+ - id
+ - key_hash
+ - guardrail_id
+ - key_name
+ - key_label
+ - assigned_by
+ - created_at
type: object
- nullable: true
- properties:
- web_search_requests:
- type: integer
- web_fetch_requests:
- type: integer
- required:
- - web_search_requests
- - web_fetch_requests
+ Legacy_ChatContentVideo:
+ deprecated: true
+ description: Video input content part (legacy format - deprecated)
example:
- web_search_requests: 1
- web_fetch_requests: 0
- AnthropicSpeed:
- type: string
- nullable: true
- enum:
- - fast
- - standard
- - null
- example: standard
- AnthropicIterationCacheCreation:
- type: object
- nullable: true
+ type: input_video
+ video_url:
+ url: https://example.com/video.mp4
properties:
- ephemeral_5m_input_tokens:
- type: integer
- ephemeral_1h_input_tokens:
- type: integer
- default: null
- example:
- ephemeral_5m_input_tokens: 0
- ephemeral_1h_input_tokens: 0
- AnthropicBaseUsageIteration:
+ type:
+ enum:
+ - input_video
+ type: string
+ video_url:
+ $ref: '#/components/schemas/ChatContentVideoInput'
+ required:
+ - type
+ - video_url
type: object
- properties:
- input_tokens:
- type: integer
- output_tokens:
- type: integer
- cache_creation_input_tokens:
- type: integer
- cache_read_input_tokens:
- type: integer
- cache_creation:
- $ref: '#/components/schemas/AnthropicIterationCacheCreation'
- example:
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: 0
- cache_read_input_tokens: 0
- cache_creation: null
- AnthropicCompactionUsageIteration:
- allOf:
- - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
- - type: object
- properties:
- type:
- type: string
- enum:
- - compaction
- required:
- - type
- example:
- type: compaction
- input_tokens: 50
- output_tokens: 25
- cache_creation_input_tokens: 0
- cache_read_input_tokens: 0
- cache_creation: null
- AnthropicMessageUsageIteration:
- allOf:
- - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
- - type: object
- properties:
- type:
- type: string
- enum:
- - message
- required:
- - type
- example:
- type: message
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: 0
- cache_read_input_tokens: 0
- cache_creation: null
- AnthropicUnknownUsageIteration:
- allOf:
- - $ref: '#/components/schemas/AnthropicBaseUsageIteration'
- - type: object
- properties:
- type:
- type: string
- required:
- - type
- example:
- type: unknown
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: 0
- cache_read_input_tokens: 0
- cache_creation: null
- AnthropicUsageIteration:
- anyOf:
- - $ref: '#/components/schemas/AnthropicCompactionUsageIteration'
- - $ref: '#/components/schemas/AnthropicMessageUsageIteration'
- - $ref: '#/components/schemas/AnthropicUnknownUsageIteration'
+ Legacy_WebSearchServerTool:
+ description: Web search tool configuration
example:
- type: message
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: 0
- cache_read_input_tokens: 0
- cache_creation: null
- AnthropicServiceTier:
- type: string
- nullable: true
- enum:
- - standard
- - priority
- - batch
- - null
- example: standard
- AnthropicUsage:
- type: object
+ engine: auto
+ filters:
+ allowed_domains:
+ - example.com
+ type: web_search
properties:
- input_tokens:
- type: integer
- output_tokens:
- type: integer
- cache_creation_input_tokens:
- type: integer
- cache_read_input_tokens:
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ filters:
+ $ref: '#/components/schemas/WebSearchDomainFilter'
+ max_results:
+ description: >-
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
type: integer
- cache_creation:
- $ref: '#/components/schemas/AnthropicCacheCreation'
- inference_geo:
+ search_context_size:
+ $ref: '#/components/schemas/SearchContextSizeEnum'
+ type:
+ enum:
+ - web_search
type: string
- nullable: true
- server_tool_use:
- $ref: '#/components/schemas/AnthropicServerToolUsage'
- service_tier:
- $ref: '#/components/schemas/AnthropicServiceTier'
+ user_location:
+ $ref: '#/components/schemas/WebSearchUserLocation'
required:
- - input_tokens
- - output_tokens
- - cache_creation_input_tokens
- - cache_read_input_tokens
- - cache_creation
- - inference_geo
- - server_tool_use
- - service_tier
- example:
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- cache_creation: null
- inference_geo: null
- server_tool_use: null
- service_tier: standard
- BaseMessagesResult:
+ - type
type: object
+ ListEndpointsResponse:
+ description: List of available endpoints for a model
+ example:
+ architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ created: 1692901234
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ endpoints:
+ - context_length: 8192
+ latency_last_30m:
+ p50: 0.25
+ p75: 0.35
+ p90: 0.48
+ p99: 0.85
+ max_completion_tokens: 4096
+ max_prompt_tokens: 8192
+ model_name: GPT-4
+ name: 'OpenAI: GPT-4'
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ provider_name: OpenAI
+ quantization: fp16
+ status: default
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ - frequency_penalty
+ - presence_penalty
+ supports_implicit_caching: true
+ tag: openai
+ throughput_last_30m:
+ p50: 45.2
+ p75: 38.5
+ p90: 28.3
+ p99: 15.1
+ uptime_last_1d: 99.8
+ uptime_last_30m: 99.5
+ uptime_last_5m: 100
+ id: openai/gpt-4
+ name: GPT-4
properties:
- id:
+ architecture:
+ allOf:
+ - $ref: '#/components/schemas/ModelArchitecture'
+ - example:
+ instruct_type: chatml
+ modality: text
+ tokenizer: GPT
+ properties:
+ input_modalities:
+ description: Supported input modalities
+ items:
+ $ref: '#/components/schemas/InputModality'
+ type: array
+ instruct_type:
+ $ref: '#/components/schemas/InstructType'
+ modality:
+ description: Primary modality of the model
+ example: text
+ nullable: true
+ type: string
+ output_modalities:
+ description: Supported output modalities
+ items:
+ $ref: '#/components/schemas/OutputModality'
+ type: array
+ tokenizer:
+ allOf:
+ - $ref: '#/components/schemas/ModelGroup'
+ - nullable: true
+ required:
+ - tokenizer
+ - instruct_type
+ - modality
+ - input_modalities
+ - output_modalities
+ created:
+ description: Unix timestamp of when the model was created
+ example: 1692901234
+ type: integer
+ description:
+ description: Description of the model
+ example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
type: string
- type:
+ endpoints:
+ description: List of available endpoints for this model
+ items:
+ $ref: '#/components/schemas/PublicEndpoint'
+ type: array
+ id:
+ description: Unique identifier for the model
+ example: openai/gpt-4
type: string
- enum:
- - message
- role:
+ name:
+ description: Display name of the model
+ example: GPT-4
type: string
- enum:
- - assistant
- container:
- $ref: '#/components/schemas/AnthropicContainer'
- content:
+ required:
+ - id
+ - name
+ - created
+ - description
+ - architecture
+ - endpoints
+ type: object
+ ListGuardrailsResponse:
+ example:
+ data:
+ - allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
+ created_at: '2025-08-24T10:30:00Z'
+ description: Guardrail for production environment
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 100
+ name: Production Guardrail
+ reset_interval: monthly
+ updated_at: '2025-08-24T15:45:00Z'
+ total_count: 1
+ properties:
+ data:
+ description: List of guardrails
+ items:
+ $ref: '#/components/schemas/Guardrail'
type: array
+ total_count:
+ description: Total number of guardrails
+ example: 25
+ type: integer
+ required:
+ - data
+ - total_count
+ type: object
+ ListKeyAssignmentsResponse:
+ example:
+ data:
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ key_label: prod-key
+ key_name: Production Key
+ total_count: 1
+ properties:
+ data:
+ description: List of key assignments
items:
- $ref: '#/components/schemas/ORAnthropicContentBlock'
- model:
+ $ref: '#/components/schemas/KeyAssignment'
+ type: array
+ total_count:
+ description: Total number of key assignments for this guardrail
+ example: 25
+ type: integer
+ required:
+ - data
+ - total_count
+ type: object
+ ListMemberAssignmentsResponse:
+ example:
+ data:
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ organization_id: org_xyz789
+ user_id: user_abc123
+ total_count: 1
+ properties:
+ data:
+ description: List of member assignments
+ items:
+ $ref: '#/components/schemas/MemberAssignment'
+ type: array
+ total_count:
+ description: Total number of member assignments
+ example: 10
+ type: integer
+ required:
+ - data
+ - total_count
+ type: object
+ McpServerTool:
+ description: MCP (Model Context Protocol) tool configuration
+ example:
+ server_label: my-server
+ server_url: https://example.com/mcp
+ type: mcp
+ properties:
+ allowed_tools:
+ anyOf:
+ - items:
+ type: string
+ type: array
+ - properties:
+ read_only:
+ type: boolean
+ tool_names:
+ items:
+ type: string
+ type: array
+ type: object
+ - nullable: true
+ authorization:
type: string
- stop_reason:
- $ref: '#/components/schemas/ORAnthropicStopReason'
- stop_sequence:
+ connector_id:
+ enum:
+ - connector_dropbox
+ - connector_gmail
+ - connector_googlecalendar
+ - connector_googledrive
+ - connector_microsoftteams
+ - connector_outlookcalendar
+ - connector_outlookemail
+ - connector_sharepoint
type: string
+ headers:
+ additionalProperties:
+ type: string
nullable: true
- usage:
- allOf:
- - $ref: '#/components/schemas/AnthropicUsage'
- - type: object
- properties:
- speed:
- $ref: '#/components/schemas/AnthropicSpeed'
- iterations:
- type: array
- items:
- $ref: '#/components/schemas/AnthropicUsageIteration'
- example:
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- cache_creation: null
- inference_geo: null
- server_tool_use: null
- service_tier: standard
- required:
- - id
- - type
- - role
- - container
- - content
- - model
- - stop_reason
- - stop_sequence
- - usage
- description: Base Anthropic Messages API response before OpenRouter extensions
- example:
- id: msg_01XFDUDYJgAACzvnptvVoYEL
- type: message
- role: assistant
- container: null
- content:
- - type: text
- text: Hello!
- citations: null
- model: claude-sonnet-4-5-20250929
- stop_reason: end_turn
- stop_sequence: null
- usage:
- input_tokens: 12
- output_tokens: 8
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- MessagesResult:
- allOf:
- - $ref: '#/components/schemas/BaseMessagesResult'
- - type: object
- properties:
- usage:
- allOf:
- - $ref: '#/components/schemas/AnthropicUsage'
- - type: object
+ type: object
+ require_approval:
+ anyOf:
+ - properties:
+ always:
properties:
- service_tier:
- type: string
- nullable: true
- speed:
- $ref: '#/components/schemas/AnthropicSpeed'
- iterations:
+ tool_names:
+ items:
+ type: string
type: array
+ type: object
+ never:
+ properties:
+ tool_names:
items:
- $ref: '#/components/schemas/AnthropicUsageIteration'
- cost:
- type: number
- format: double
- is_byok:
- type: boolean
- cost_details:
- type: object
- nullable: true
- properties:
- upstream_inference_cost:
- type: number
- format: double
- upstream_inference_prompt_cost:
- type: number
- format: double
- upstream_inference_completions_cost:
- type: number
- format: double
- required:
- - upstream_inference_prompt_cost
- - upstream_inference_completions_cost
- example:
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- cache_creation: null
- inference_geo: null
- server_tool_use: null
- service_tier: standard
- provider:
- $ref: '#/components/schemas/ProviderName'
- description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions
- example:
- id: msg_01XFDUDYJgAACzvnptvVoYEL
- type: message
- role: assistant
- container: null
- content:
- - type: text
- text: Hello! I'm doing well, thank you for asking.
- citations: null
- model: claude-sonnet-4-5-20250929
- stop_reason: end_turn
- stop_sequence: null
- usage:
- input_tokens: 12
- output_tokens: 15
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- cache_creation: null
- inference_geo: null
- server_tool_use: null
- service_tier: standard
- MessagesStartEvent:
+ type: string
+ type: array
+ type: object
+ type: object
+ - enum:
+ - always
+ type: string
+ - enum:
+ - never
+ type: string
+ - nullable: true
+ server_description:
+ type: string
+ server_label:
+ type: string
+ server_url:
+ type: string
+ type:
+ enum:
+ - mcp
+ type: string
+ required:
+ - type
+ - server_label
type: object
+ MemberAssignment:
+ example:
+ assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ organization_id: org_xyz789
+ user_id: user_abc123
properties:
- type:
+ assigned_by:
+ description: User ID of who made the assignment
+ example: user_abc123
+ nullable: true
type: string
- enum:
- - message_start
- message:
- type: object
- properties:
- id:
- type: string
- type:
- type: string
- enum:
- - message
- role:
- type: string
- enum:
- - assistant
- container:
- $ref: '#/components/schemas/AnthropicContainer'
- content:
- type: array
- items:
- $ref: '#/components/schemas/ORAnthropicContentBlock'
- model:
- type: string
- stop_reason:
- nullable: true
- stop_sequence:
- nullable: true
- usage:
- allOf:
- - $ref: '#/components/schemas/AnthropicUsage'
- - type: object
- properties:
- speed:
- $ref: '#/components/schemas/AnthropicSpeed'
- iterations:
- type: array
- items:
- $ref: '#/components/schemas/AnthropicUsageIteration'
- example:
- input_tokens: 100
- output_tokens: 50
- cache_creation_input_tokens: null
- cache_read_input_tokens: null
- cache_creation: null
- inference_geo: null
- server_tool_use: null
- service_tier: standard
- provider:
- type: string
- enum:
- - AnyScale
- - Atoma
- - Cent-ML
- - CrofAI
- - Enfer
- - GoPomelo
- - HuggingFace
- - Hyperbolic 2
- - InoCloud
- - Kluster
- - Lambda
- - Lepton
- - Lynn 2
- - Lynn
- - Mancer
- - Meta
- - Modal
- - Nineteen
- - OctoAI
- - Recursal
- - Reflection
- - Replicate
- - SambaNova 2
- - SF Compute
- - Targon
- - Together 2
- - Ubicloud
- - 01.AI
- - AkashML
- - AI21
- - AionLabs
- - Alibaba
- - Ambient
- - Amazon Bedrock
- - Amazon Nova
- - Anthropic
- - Arcee AI
- - AtlasCloud
- - Avian
- - Azure
- - BaseTen
- - BytePlus
- - Black Forest Labs
- - Cerebras
- - Chutes
- - Cirrascale
- - Clarifai
- - Cloudflare
- - Cohere
- - Crusoe
- - DeepInfra
- - DeepSeek
- - Featherless
- - Fireworks
- - Friendli
- - GMICloud
- - Google
- - Google AI Studio
- - Groq
- - Hyperbolic
- - Inception
- - Inceptron
- - InferenceNet
- - Ionstream
- - Infermatic
- - Io Net
- - Inflection
- - Liquid
- - Mara
- - Mancer 2
- - Minimax
- - ModelRun
- - Mistral
- - Modular
- - Moonshot AI
- - Morph
- - NCompass
- - Nebius
- - NextBit
- - Novita
- - Nvidia
- - OpenAI
- - OpenInference
- - Parasail
- - Perplexity
- - Phala
- - Reka
- - Relace
- - SambaNova
- - Seed
- - SiliconFlow
- - Sourceful
- - StepFun
- - Stealth
- - StreamLake
- - Switchpoint
- - Together
- - Upstage
- - Venice
- - WandB
- - Xiaomi
- - xAI
- - Z.AI
- - FakeProvider
- required:
- - id
- - type
- - role
- - container
- - content
- - model
- - stop_reason
- - stop_sequence
- - usage
- required:
- - type
- - message
- description: Event sent at the start of a streaming message
- example:
- type: message_start
- message:
- id: msg_01XFDUDYJgAACzvnptvVoYEL
- type: message
- role: assistant
- content: []
- model: claude-sonnet-4-5-20250929
- stop_reason: null
- stop_sequence: null
- usage:
- input_tokens: 12
- output_tokens: 0
- MessagesDeltaEvent:
- type: object
- properties:
- type:
+ created_at:
+ description: ISO 8601 timestamp of when the assignment was created
+ example: '2025-08-24T10:30:00Z'
type: string
- enum:
- - message_delta
- delta:
- type: object
- properties:
- container:
- $ref: '#/components/schemas/AnthropicContainer'
- stop_reason:
- $ref: '#/components/schemas/ORAnthropicStopReason'
- stop_sequence:
- type: string
- nullable: true
- required:
- - container
- - stop_reason
- - stop_sequence
- usage:
- type: object
- properties:
- input_tokens:
- type: integer
- nullable: true
- output_tokens:
- type: integer
- cache_creation_input_tokens:
- type: integer
- nullable: true
- cache_read_input_tokens:
- type: integer
- nullable: true
- server_tool_use:
- type: object
- nullable: true
- properties:
- web_search_requests:
- type: integer
- web_fetch_requests:
- type: integer
- required:
- - web_search_requests
- - web_fetch_requests
- iterations:
- type: array
- items:
- $ref: '#/components/schemas/AnthropicUsageIteration'
- required:
- - input_tokens
- - output_tokens
- - cache_creation_input_tokens
- - cache_read_input_tokens
- - server_tool_use
- required:
- - type
- - delta
- - usage
- description: Event sent when the message metadata changes (e.g., stop_reason)
- example:
- type: message_delta
- delta:
- stop_reason: end_turn
- stop_sequence: null
- usage:
- output_tokens: 15
- MessagesStopEvent:
- type: object
- properties:
- type:
+ guardrail_id:
+ description: ID of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440001
+ format: uuid
type: string
- enum:
- - message_stop
- required:
- - type
- description: Event sent when the message is complete
- example:
- type: message_stop
- MessagesContentBlockStartEvent:
- type: object
- properties:
- type:
+ id:
+ description: Unique identifier for the assignment
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ organization_id:
+ description: Organization ID
+ example: org_xyz789
+ type: string
+ user_id:
+ description: Clerk user ID of the assigned member
+ example: user_abc123
type: string
- enum:
- - content_block_start
- index:
- type: integer
- content_block:
- anyOf:
- - $ref: '#/components/schemas/AnthropicTextBlock'
- - $ref: '#/components/schemas/AnthropicToolUseBlock'
- - $ref: '#/components/schemas/AnthropicThinkingBlock'
- - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock'
- - $ref: '#/components/schemas/AnthropicServerToolUseBlock'
- - $ref: '#/components/schemas/AnthropicWebSearchToolResult'
- - $ref: '#/components/schemas/AnthropicWebFetchToolResult'
- - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
- - $ref: '#/components/schemas/AnthropicToolSearchToolResult'
- - $ref: '#/components/schemas/AnthropicContainerUpload'
- - $ref: '#/components/schemas/AnthropicCompactionBlock'
- - type: object
- properties:
- type:
- type: string
- enum:
- - compaction
- content:
- type: string
- nullable: true
- required:
- - type
- - content
required:
- - type
- - index
- - content_block
- description: Event sent when a new content block starts
+ - id
+ - user_id
+ - organization_id
+ - guardrail_id
+ - assigned_by
+ - created_at
+ type: object
+ MessagesContentBlockDeltaEvent:
+ description: Event sent when content is added to a content block
example:
- type: content_block_start
+ delta:
+ text: Hello
+ type: text_delta
index: 0
- content_block:
- type: text
- text: ''
- MessagesContentBlockDeltaEvent:
- type: object
+ type: content_block_delta
properties:
- type:
- type: string
- enum:
- - content_block_delta
- index:
- type: integer
delta:
oneOf:
- - type: object
- properties:
- type:
+ - properties:
+ text:
type: string
+ type:
enum:
- text_delta
- text:
type: string
required:
- type
- text
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ partial_json:
type: string
+ type:
enum:
- input_json_delta
- partial_json:
type: string
required:
- type
- partial_json
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ thinking:
type: string
+ type:
enum:
- thinking_delta
- thinking:
type: string
required:
- type
- thinking
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ signature:
type: string
+ type:
enum:
- signature_delta
- signature:
type: string
required:
- type
- signature
- - type: object
- properties:
- type:
- type: string
- enum:
- - citations_delta
+ type: object
+ - properties:
citation:
+ discriminator:
+ mapping:
+ char_location: '#/components/schemas/AnthropicCitationCharLocation'
+ content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation'
+ page_location: '#/components/schemas/AnthropicCitationPageLocation'
+ search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
+ propertyName: type
oneOf:
- $ref: '#/components/schemas/AnthropicCitationCharLocation'
- $ref: '#/components/schemas/AnthropicCitationPageLocation'
- $ref: '#/components/schemas/AnthropicCitationContentBlockLocation'
- $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- $ref: '#/components/schemas/AnthropicCitationSearchResultLocation'
- discriminator:
- propertyName: type
- mapping:
- char_location: '#/components/schemas/AnthropicCitationCharLocation'
- page_location: '#/components/schemas/AnthropicCitationPageLocation'
- content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocation'
- web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
+ type:
+ enum:
+ - citations_delta
+ type: string
required:
- type
- citation
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ content:
+ nullable: true
type: string
+ type:
enum:
- compaction_delta
- content:
type: string
- nullable: true
required:
- type
- content
+ type: object
+ index:
+ type: integer
+ type:
+ enum:
+ - content_block_delta
+ type: string
required:
- type
- index
- delta
- description: Event sent when content is added to a content block
+ type: object
+ MessagesContentBlockStartEvent:
+ description: Event sent when a new content block starts
example:
- type: content_block_delta
+ content_block:
+ text: ''
+ type: text
index: 0
- delta:
- type: text_delta
- text: Hello
- MessagesContentBlockStopEvent:
- type: object
+ type: content_block_start
properties:
- type:
- type: string
- enum:
- - content_block_stop
+ content_block:
+ anyOf:
+ - $ref: '#/components/schemas/AnthropicTextBlock'
+ - $ref: '#/components/schemas/AnthropicToolUseBlock'
+ - $ref: '#/components/schemas/AnthropicThinkingBlock'
+ - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock'
+ - $ref: '#/components/schemas/AnthropicServerToolUseBlock'
+ - $ref: '#/components/schemas/AnthropicWebSearchToolResult'
+ - $ref: '#/components/schemas/AnthropicWebFetchToolResult'
+ - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicToolSearchToolResult'
+ - $ref: '#/components/schemas/AnthropicContainerUpload'
+ - $ref: '#/components/schemas/AnthropicCompactionBlock'
+ - properties:
+ content:
+ nullable: true
+ type: string
+ type:
+ enum:
+ - compaction
+ type: string
+ required:
+ - type
+ - content
+ type: object
index:
type: integer
+ type:
+ enum:
+ - content_block_start
+ type: string
required:
- type
- index
+ - content_block
+ type: object
+ MessagesContentBlockStopEvent:
description: Event sent when a content block is complete
example:
- type: content_block_stop
index: 0
- MessagesPingEvent:
- type: object
+ type: content_block_stop
properties:
+ index:
+ type: integer
type:
- type: string
enum:
- - ping
+ - content_block_stop
+ type: string
required:
- type
- description: Keep-alive ping event
- example:
- type: ping
- MessagesErrorEvent:
+ - index
type: object
+ MessagesDeltaEvent:
+ description: Event sent when the message metadata changes (e.g., stop_reason)
+ example:
+ delta:
+ stop_reason: end_turn
+ stop_sequence: null
+ type: message_delta
+ usage:
+ output_tokens: 15
properties:
+ delta:
+ properties:
+ container:
+ $ref: '#/components/schemas/AnthropicContainer'
+ stop_reason:
+ $ref: '#/components/schemas/ORAnthropicStopReason'
+ stop_sequence:
+ nullable: true
+ type: string
+ required:
+ - container
+ - stop_reason
+ - stop_sequence
+ type: object
type:
- type: string
enum:
- - error
- error:
- type: object
+ - message_delta
+ type: string
+ usage:
properties:
- type:
- type: string
- message:
- type: string
+ cache_creation_input_tokens:
+ nullable: true
+ type: integer
+ cache_read_input_tokens:
+ nullable: true
+ type: integer
+ input_tokens:
+ nullable: true
+ type: integer
+ iterations:
+ items:
+ $ref: '#/components/schemas/AnthropicUsageIteration'
+ type: array
+ output_tokens:
+ type: integer
+ server_tool_use:
+ nullable: true
+ properties:
+ web_fetch_requests:
+ type: integer
+ web_search_requests:
+ type: integer
+ required:
+ - web_search_requests
+ - web_fetch_requests
+ type: object
required:
- - type
- - message
+ - input_tokens
+ - output_tokens
+ - cache_creation_input_tokens
+ - cache_read_input_tokens
+ - server_tool_use
+ type: object
required:
- type
- - error
- description: Error event in the stream
- example:
- type: error
- error:
- type: overloaded_error
- message: Overloaded
- MessagesStreamEvents:
- oneOf:
- - $ref: '#/components/schemas/MessagesStartEvent'
- - $ref: '#/components/schemas/MessagesDeltaEvent'
- - $ref: '#/components/schemas/MessagesStopEvent'
- - $ref: '#/components/schemas/MessagesContentBlockStartEvent'
- - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent'
- - $ref: '#/components/schemas/MessagesContentBlockStopEvent'
- - $ref: '#/components/schemas/MessagesPingEvent'
- - $ref: '#/components/schemas/MessagesErrorEvent'
- discriminator:
- propertyName: type
- mapping:
- message_start: '#/components/schemas/MessagesStartEvent'
- message_delta: '#/components/schemas/MessagesDeltaEvent'
- message_stop: '#/components/schemas/MessagesStopEvent'
- content_block_start: '#/components/schemas/MessagesContentBlockStartEvent'
- content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent'
- content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent'
- ping: '#/components/schemas/MessagesPingEvent'
- error: '#/components/schemas/MessagesErrorEvent'
- description: Union of all possible streaming events
- example:
- type: content_block_delta
- index: 0
- delta:
- type: text_delta
- text: Hello
- MessagesErrorDetail:
+ - delta
+ - usage
type: object
+ MessagesErrorDetail:
+ example:
+ message: Invalid request parameters
+ type: invalid_request_error
properties:
- type:
- type: string
message:
type: string
+ type:
+ type: string
required:
- type
- message
- example:
- type: invalid_request_error
- message: Invalid request parameters
- MessagesErrorResponse:
type: object
+ MessagesErrorEvent:
+ description: Error event in the stream
+ example:
+ error:
+ message: Overloaded
+ type: overloaded_error
+ type: error
properties:
+ error:
+ properties:
+ message:
+ type: string
+ type:
+ type: string
+ required:
+ - type
+ - message
+ type: object
type:
- type: string
enum:
- error
- error:
- $ref: '#/components/schemas/MessagesErrorDetail'
+ type: string
required:
- type
- error
+ type: object
+ MessagesErrorResponse:
example:
- type: error
error:
- type: invalid_request_error
message: Invalid request parameters
- AnthropicCitationCharLocationParam:
- type: object
+ type: invalid_request_error
+ type: error
properties:
+ error:
+ $ref: '#/components/schemas/MessagesErrorDetail'
type:
- type: string
enum:
- - char_location
- cited_text:
- type: string
- document_index:
- type: integer
- document_title:
+ - error
type: string
- nullable: true
- start_char_index:
- type: integer
- end_char_index:
- type: integer
required:
- type
- - cited_text
- - document_index
- - document_title
- - start_char_index
- - end_char_index
- example:
- type: char_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_char_index: 0
- end_char_index: 18
- AnthropicCitationPageLocationParam:
+ - error
type: object
+ MessagesMessageParam:
+ description: Anthropic message with OpenRouter extensions
+ example:
+ content: Hello, how are you?
+ role: user
properties:
- type:
- type: string
+ content:
+ anyOf:
+ - type: string
+ - items:
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicTextBlockParam'
+ - $ref: '#/components/schemas/AnthropicImageBlockParam'
+ - $ref: '#/components/schemas/AnthropicDocumentBlockParam'
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ id:
+ type: string
+ input:
+ nullable: true
+ name:
+ type: string
+ type:
+ enum:
+ - tool_use
+ type: string
+ required:
+ - type
+ - id
+ - name
+ type: object
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ content:
+ anyOf:
+ - type: string
+ - items:
+ anyOf:
+ - $ref: '#/components/schemas/AnthropicTextBlockParam'
+ - $ref: '#/components/schemas/AnthropicImageBlockParam'
+ - properties:
+ tool_name:
+ type: string
+ type:
+ enum:
+ - tool_reference
+ type: string
+ required:
+ - type
+ - tool_name
+ type: object
+ - $ref: '#/components/schemas/AnthropicSearchResultBlockParam'
+ - $ref: '#/components/schemas/AnthropicDocumentBlockParam'
+ type: array
+ is_error:
+ type: boolean
+ tool_use_id:
+ type: string
+ type:
+ enum:
+ - tool_result
+ type: string
+ required:
+ - type
+ - tool_use_id
+ type: object
+ - properties:
+ signature:
+ type: string
+ thinking:
+ type: string
+ type:
+ enum:
+ - thinking
+ type: string
+ required:
+ - type
+ - thinking
+ - signature
+ type: object
+ - properties:
+ data:
+ type: string
+ type:
+ enum:
+ - redacted_thinking
+ type: string
+ required:
+ - type
+ - data
+ type: object
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ id:
+ type: string
+ input:
+ nullable: true
+ name:
+ $ref: '#/components/schemas/AnthropicServerToolName'
+ type:
+ enum:
+ - server_tool_use
+ type: string
+ required:
+ - type
+ - id
+ - name
+ type: object
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ content:
+ anyOf:
+ - items:
+ $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam'
+ type: array
+ - properties:
+ error_code:
+ enum:
+ - invalid_tool_input
+ - unavailable
+ - max_uses_exceeded
+ - too_many_requests
+ - query_too_long
+ type: string
+ type:
+ enum:
+ - web_search_tool_result_error
+ type: string
+ required:
+ - type
+ - error_code
+ type: object
+ tool_use_id:
+ type: string
+ type:
+ enum:
+ - web_search_tool_result
+ type: string
+ required:
+ - type
+ - tool_use_id
+ - content
+ type: object
+ - $ref: '#/components/schemas/AnthropicSearchResultBlockParam'
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ content:
+ nullable: true
+ type: string
+ type:
+ enum:
+ - compaction
+ type: string
+ required:
+ - type
+ - content
+ type: object
+ type: array
+ role:
enum:
- - page_location
- cited_text:
- type: string
- document_index:
- type: integer
- document_title:
+ - user
+ - assistant
type: string
- nullable: true
- start_page_number:
- type: integer
- end_page_number:
- type: integer
required:
- - type
- - cited_text
- - document_index
- - document_title
- - start_page_number
- - end_page_number
- example:
- type: page_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_page_number: 1
- end_page_number: 2
- AnthropicCitationContentBlockLocationParam:
+ - role
+ - content
type: object
+ MessagesOutputConfig:
+ description: Configuration for controlling output behavior. Supports the effort parameter and structured output format.
+ example:
+ effort: medium
properties:
- type:
- type: string
+ effort:
+ description: >-
+ How much effort the model should put into its response. Higher effort levels may result in more thorough
+ analysis but take longer. Valid values are `low`, `medium`, `high`, or `max`.
enum:
- - content_block_location
- cited_text:
- type: string
- document_index:
- type: integer
- document_title:
+ - low
+ - medium
+ - high
+ - max
+ - null
+ example: medium
+ nullable: true
type: string
- nullable: true
- start_block_index:
- type: integer
- end_block_index:
- type: integer
- required:
- - type
- - cited_text
- - document_index
- - document_title
- - start_block_index
- - end_block_index
- example:
- type: content_block_location
- cited_text: Example cited text
- document_index: 0
- document_title: null
- start_block_index: 0
- end_block_index: 1
- AnthropicCacheControlTtl:
- type: string
- enum:
- - 5m
- - 1h
- example: 5m
- AnthropicCacheControlDirective:
- type: object
- properties:
- type:
- type: string
- enum:
- - ephemeral
- ttl:
- $ref: '#/components/schemas/AnthropicCacheControlTtl'
- required:
- - type
- example:
- type: ephemeral
- AnthropicTextBlockParam:
- type: object
- properties:
- type:
- type: string
- enum:
- - text
- text:
- type: string
- citations:
- type: array
- nullable: true
- items:
- oneOf:
- - $ref: '#/components/schemas/AnthropicCitationCharLocationParam'
- - $ref: '#/components/schemas/AnthropicCitationPageLocationParam'
- - $ref: '#/components/schemas/AnthropicCitationContentBlockLocationParam'
- - $ref: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- - $ref: '#/components/schemas/AnthropicCitationSearchResultLocation'
- discriminator:
- propertyName: type
- mapping:
- char_location: '#/components/schemas/AnthropicCitationCharLocationParam'
- page_location: '#/components/schemas/AnthropicCitationPageLocationParam'
- content_block_location: '#/components/schemas/AnthropicCitationContentBlockLocationParam'
- web_search_result_location: '#/components/schemas/AnthropicCitationWebSearchResultLocation'
- search_result_location: '#/components/schemas/AnthropicCitationSearchResultLocation'
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - text
- example:
- type: text
- text: Hello, world!
- AnthropicWebSearchToolUserLocation:
- type: object
- nullable: true
- properties:
- type:
- type: string
- enum:
- - approximate
- city:
- type: string
- nullable: true
- country:
- type: string
- nullable: true
- region:
- type: string
- nullable: true
- timezone:
- type: string
- nullable: true
- required:
- - type
- example:
- type: approximate
- city: San Francisco
- country: US
- region: California
- timezone: America/Los_Angeles
- SearchQualityLevel:
- type: string
- enum:
- - low
- - medium
- - high
- description: >-
- How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa
- engine; ignored with native provider search.
- example: medium
- WebSearchUserLocationServerTool:
- type: object
- properties:
- type:
- type: string
- enum:
- - approximate
- city:
- type: string
- region:
- type: string
- country:
- type: string
- timezone:
- type: string
- description: Approximate user location for location-biased results.
- example:
- type: approximate
- city: San Francisco
- region: California
- country: US
- timezone: America/Los_Angeles
- WebSearchConfig:
- type: object
- properties:
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
- type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
- max_total_results:
- type: integer
- description: >-
- Maximum total number of search results across all search calls in a single request. Once this limit is
- reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
- loops.
- example: 20
- search_context_size:
- $ref: '#/components/schemas/SearchQualityLevel'
- user_location:
- $ref: '#/components/schemas/WebSearchUserLocationServerTool'
- allowed_domains:
- type: array
- items:
- type: string
- description: >-
- Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic,
- OpenAI, xAI). Not supported with Firecrawl or Perplexity.
- excluded_domains:
- type: array
- items:
- type: string
- description: >-
- Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported
- with Firecrawl, OpenAI (silently ignored), or Perplexity.
- example:
- max_results: 5
- search_context_size: medium
- OpenRouterWebSearchServerTool:
- type: object
- properties:
- type:
- type: string
- enum:
- - openrouter:web_search
- parameters:
- $ref: '#/components/schemas/WebSearchConfig'
- required:
- - type
- description: 'OpenRouter built-in server tool: searches the web for current information'
- example:
- type: openrouter:web_search
- parameters:
- max_results: 5
- MessagesOutputConfig:
- type: object
- properties:
- effort:
- type: string
- nullable: true
- enum:
- - low
- - medium
- - high
- - max
- - null
- description: >-
- How much effort the model should put into its response. Higher effort levels may result in more thorough
- analysis but take longer. Valid values are `low`, `medium`, `high`, or `max`.
- example: medium
- format:
- type: object
+ format:
+ description: >-
+ A schema to specify Claude's output format in responses. See [structured
+ outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs).
nullable: true
properties:
- type:
- type: string
- enum:
- - json_schema
schema:
- type: object
additionalProperties:
nullable: true
+ type: object
+ type:
+ enum:
+ - json_schema
+ type: string
required:
- type
- schema
- description: >-
- A schema to specify Claude's output format in responses. See [structured
- outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs).
- description: Configuration for controlling output behavior. Supports the effort parameter and structured output format.
- example:
- effort: medium
- AnthropicImageMimeType:
- type: string
- enum:
- - image/jpeg
- - image/png
- - image/gif
- - image/webp
- example: image/jpeg
- AnthropicBase64ImageSource:
+ type: object
type: object
- properties:
- type:
- type: string
- enum:
- - base64
- media_type:
- $ref: '#/components/schemas/AnthropicImageMimeType'
- data:
- type: string
- required:
- - type
- - media_type
- - data
+ MessagesPingEvent:
+ description: Keep-alive ping event
example:
- type: base64
- media_type: image/jpeg
- data: /9j/4AAQ...
- AnthropicUrlImageSource:
- type: object
+ type: ping
properties:
type:
- type: string
enum:
- - url
- url:
+ - ping
type: string
required:
- type
- - url
- example:
- type: url
- url: https://example.com/image.jpg
- AnthropicImageBlockParam:
type: object
+ MessagesRequest:
+ description: Request schema for Anthropic Messages API endpoint
+ example:
+ max_tokens: 1024
+ messages:
+ - content: Hello, how are you?
+ role: user
+ model: anthropic/claude-4.5-sonnet-20250929
+ temperature: 0.7
properties:
- type:
- type: string
- enum:
- - image
- source:
- oneOf:
- - $ref: '#/components/schemas/AnthropicBase64ImageSource'
- - $ref: '#/components/schemas/AnthropicUrlImageSource'
- discriminator:
- propertyName: type
- mapping:
- base64: '#/components/schemas/AnthropicBase64ImageSource'
- url: '#/components/schemas/AnthropicUrlImageSource'
cache_control:
$ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - source
- example:
- type: image
- source:
- type: base64
- media_type: image/jpeg
- data: /9j/4AAQ...
- AnthropicUrlPdfSource:
- type: object
- properties:
- type:
- type: string
- enum:
- - url
- url:
- type: string
- required:
- - type
- - url
- example:
- type: url
- url: https://example.com/document.pdf
- AnthropicDocumentBlockParam:
- type: object
- properties:
- type:
- type: string
- enum:
- - document
- source:
- oneOf:
- - $ref: '#/components/schemas/AnthropicBase64PdfSource'
- - $ref: '#/components/schemas/AnthropicPlainTextSource'
- - type: object
- properties:
- type:
- type: string
- enum:
- - content
- content:
- anyOf:
- - type: string
- - type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/AnthropicTextBlockParam'
- - $ref: '#/components/schemas/AnthropicImageBlockParam'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/AnthropicTextBlockParam'
- image: '#/components/schemas/AnthropicImageBlockParam'
- required:
- - type
- - content
- - $ref: '#/components/schemas/AnthropicUrlPdfSource'
- citations:
- type: object
- nullable: true
- properties:
- enabled:
- type: boolean
- context:
- type: string
- nullable: true
- title:
- type: string
+ context_management:
nullable: true
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - source
- example:
- type: document
- source:
- type: text
- media_type: text/plain
- data: Hello, world!
- AnthropicSearchResultBlockParam:
- type: object
- properties:
- type:
- type: string
- enum:
- - search_result
- source:
- type: string
- title:
- type: string
- content:
- type: array
- items:
- $ref: '#/components/schemas/AnthropicTextBlockParam'
- citations:
- type: object
properties:
- enabled:
- type: boolean
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - source
- - title
- - content
- example:
- type: search_result
- source: example_source
- title: Example Result
- content:
- - type: text
- text: Result content
- AnthropicWebSearchResultBlockParam:
- type: object
- properties:
- type:
- type: string
- enum:
- - web_search_result
- encrypted_content:
- type: string
- title:
- type: string
- url:
- type: string
- page_age:
- type: string
- nullable: true
- required:
- - type
- - encrypted_content
- - title
- - url
- example:
- type: web_search_result
- encrypted_content: enc_content_0
- title: Example Page
- url: https://example.com
- MessagesMessageParam:
- type: object
- properties:
- role:
- type: string
- enum:
- - user
- - assistant
- content:
- anyOf:
- - type: string
- - type: array
+ edits:
items:
oneOf:
- - $ref: '#/components/schemas/AnthropicTextBlockParam'
- - $ref: '#/components/schemas/AnthropicImageBlockParam'
- - $ref: '#/components/schemas/AnthropicDocumentBlockParam'
- - type: object
- properties:
- type:
- type: string
- enum:
- - tool_use
- id:
- type: string
- name:
- type: string
- input:
+ - properties:
+ clear_at_least:
+ $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast'
+ clear_tool_inputs:
+ anyOf:
+ - type: boolean
+ - items:
+ type: string
+ type: array
+ - nullable: true
+ exclude_tools:
+ items:
+ type: string
nullable: true
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - id
- - name
- - type: object
- properties:
+ type: array
+ keep:
+ $ref: '#/components/schemas/AnthropicToolUsesKeep'
+ trigger:
+ discriminator:
+ mapping:
+ input_tokens: '#/components/schemas/AnthropicInputTokensTrigger'
+ tool_uses: '#/components/schemas/AnthropicToolUsesTrigger'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicInputTokensTrigger'
+ - $ref: '#/components/schemas/AnthropicToolUsesTrigger'
type:
- type: string
enum:
- - tool_result
- tool_use_id:
+ - clear_tool_uses_20250919
type: string
- content:
- anyOf:
- - type: string
- - type: array
- items:
- anyOf:
- - $ref: '#/components/schemas/AnthropicTextBlockParam'
- - $ref: '#/components/schemas/AnthropicImageBlockParam'
- - type: object
- properties:
- type:
- type: string
- enum:
- - tool_reference
- tool_name:
- type: string
- required:
- - type
- - tool_name
- - $ref: '#/components/schemas/AnthropicSearchResultBlockParam'
- - $ref: '#/components/schemas/AnthropicDocumentBlockParam'
- is_error:
- type: boolean
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- - tool_use_id
- - type: object
- properties:
+ type: object
+ - properties:
+ keep:
+ anyOf:
+ - $ref: '#/components/schemas/AnthropicThinkingTurns'
+ - properties:
+ type:
+ enum:
+ - all
+ type: string
+ required:
+ - type
+ type: object
+ - enum:
+ - all
+ type: string
type:
- type: string
enum:
- - thinking
- thinking:
- type: string
- signature:
+ - clear_thinking_20251015
type: string
required:
- type
- - thinking
- - signature
- - type: object
- properties:
- type:
- type: string
- enum:
- - redacted_thinking
- data:
- type: string
- required:
- - type
- - data
- - type: object
- properties:
- type:
- type: string
- enum:
- - server_tool_use
- id:
- type: string
- name:
- $ref: '#/components/schemas/AnthropicServerToolName'
- input:
+ type: object
+ - properties:
+ instructions:
nullable: true
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - id
- - name
- - type: object
- properties:
- type:
- type: string
- enum:
- - web_search_tool_result
- tool_use_id:
type: string
- content:
- anyOf:
- - type: array
- items:
- $ref: '#/components/schemas/AnthropicWebSearchResultBlockParam'
- - type: object
- properties:
- type:
- type: string
- enum:
- - web_search_tool_result_error
- error_code:
- type: string
- enum:
- - invalid_tool_input
- - unavailable
- - max_uses_exceeded
- - too_many_requests
- - query_too_long
- required:
- - type
- - error_code
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- required:
- - type
- - tool_use_id
- - content
- - $ref: '#/components/schemas/AnthropicSearchResultBlockParam'
- - type: object
- properties:
+ pause_after_compaction:
+ type: boolean
+ trigger:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicInputTokensTrigger'
+ - nullable: true
+ properties: {}
+ type: object
+ example:
+ type: input_tokens
+ value: 100000
type:
- type: string
enum:
- - compaction
- content:
+ - compact_20260112
type: string
- nullable: true
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- - content
- required:
- - role
- - content
- description: Anthropic message with OpenRouter extensions
- example:
- role: user
- content: Hello, how are you?
- AnthropicInputTokensClearAtLeast:
- type: object
- nullable: true
- properties:
- type:
- type: string
- enum:
- - input_tokens
- value:
- type: integer
- required:
- - type
- - value
- example:
- type: input_tokens
- value: 50000
- AnthropicToolUsesKeep:
- type: object
- properties:
- type:
- type: string
- enum:
- - tool_uses
- value:
- type: integer
- required:
- - type
- - value
- example:
- type: tool_uses
- value: 5
- AnthropicInputTokensTrigger:
- type: object
- properties:
- type:
- type: string
- enum:
- - input_tokens
- value:
- type: integer
- required:
- - type
- - value
- example:
- type: input_tokens
- value: 100000
- AnthropicToolUsesTrigger:
- type: object
- properties:
- type:
- type: string
- enum:
- - tool_uses
- value:
- type: integer
- required:
- - type
- - value
- example:
- type: tool_uses
- value: 10
- AnthropicThinkingTurns:
- type: object
- properties:
- type:
- type: string
- enum:
- - thinking_turns
- value:
- type: integer
- required:
- - type
- - value
- example:
- type: thinking_turns
- value: 3
- MessagesRequest:
- type: object
- properties:
- model:
- type: string
+ type: object
+ type: array
+ type: object
max_tokens:
type: integer
- system:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/AnthropicTextBlockParam'
+ messages:
+ items:
+ $ref: '#/components/schemas/MessagesMessageParam'
+ nullable: true
+ type: array
metadata:
- type: object
properties:
user_id:
- type: string
nullable: true
- stop_sequences:
+ type: string
+ type: object
+ model:
+ type: string
+ models:
+ items:
+ type: string
+ type: array
+ output_config:
+ $ref: '#/components/schemas/MessagesOutputConfig'
+ plugins:
+ description: Plugins you want to enable for this request, including their settings.
+ items:
+ discriminator:
+ mapping:
+ auto-router: '#/components/schemas/AutoRouterPlugin'
+ context-compression: '#/components/schemas/ContextCompressionPlugin'
+ file-parser: '#/components/schemas/FileParserPlugin'
+ moderation: '#/components/schemas/ModerationPlugin'
+ response-healing: '#/components/schemas/ResponseHealingPlugin'
+ web: '#/components/schemas/WebSearchPlugin'
+ propertyName: id
+ oneOf:
+ - $ref: '#/components/schemas/AutoRouterPlugin'
+ - $ref: '#/components/schemas/ModerationPlugin'
+ - $ref: '#/components/schemas/WebSearchPlugin'
+ - $ref: '#/components/schemas/FileParserPlugin'
+ - $ref: '#/components/schemas/ResponseHealingPlugin'
+ - $ref: '#/components/schemas/ContextCompressionPlugin'
type: array
+ provider:
+ $ref: '#/components/schemas/ProviderPreferences'
+ route:
+ $ref: '#/components/schemas/DeprecatedRoute'
+ service_tier:
+ enum:
+ - auto
+ - standard_only
+ type: string
+ session_id:
+ description: >-
+ A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
+ observability. If provided in both the request body and the x-session-id header, the body value takes
+ precedence. Maximum of 256 characters.
+ maxLength: 256
+ type: string
+ speed:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicSpeed'
+ - description: >-
+ Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at
+ premium pricing. Defaults to `standard` when omitted.
+ example: fast
+ stop_sequences:
items:
type: string
+ type: array
+ stream:
+ type: boolean
+ system:
+ anyOf:
+ - type: string
+ - items:
+ $ref: '#/components/schemas/AnthropicTextBlockParam'
+ type: array
temperature:
- type: number
format: double
- top_p:
type: number
- format: double
- top_k:
- type: integer
- tools:
- type: array
- items:
- anyOf:
- - type: object
- properties:
- name:
- type: string
- description:
- type: string
- input_schema:
- type: object
- properties:
- type:
- type: string
- default: object
+ thinking:
+ oneOf:
+ - properties:
+ budget_tokens:
+ type: integer
+ type:
+ enum:
+ - enabled
+ type: string
+ required:
+ - type
+ - budget_tokens
+ type: object
+ - properties:
+ type:
+ enum:
+ - disabled
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ type:
+ enum:
+ - adaptive
+ type: string
+ required:
+ - type
+ type: object
+ tool_choice:
+ oneOf:
+ - properties:
+ disable_parallel_tool_use:
+ type: boolean
+ type:
+ enum:
+ - auto
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ disable_parallel_tool_use:
+ type: boolean
+ type:
+ enum:
+ - any
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ type:
+ enum:
+ - none
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ disable_parallel_tool_use:
+ type: boolean
+ name:
+ type: string
+ type:
+ enum:
+ - tool
+ type: string
+ required:
+ - type
+ - name
+ type: object
+ tools:
+ items:
+ anyOf:
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ description:
+ type: string
+ input_schema:
+ additionalProperties:
+ nullable: true
+ properties:
properties:
nullable: true
required:
- type: array
- nullable: true
items:
type: string
- additionalProperties:
- nullable: true
- type:
+ nullable: true
+ type: array
+ type:
+ default: object
+ type: string
+ type: object
+ name:
type: string
+ type:
enum:
- custom
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ type: string
required:
- name
- input_schema
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ name:
+ enum:
+ - bash
type: string
+ type:
enum:
- bash_20250124
- name:
type: string
- enum:
- - bash
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- name
- - type: object
- properties:
- type:
+ type: object
+ - properties:
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
+ name:
+ enum:
+ - str_replace_editor
type: string
+ type:
enum:
- text_editor_20250124
- name:
type: string
- enum:
- - str_replace_editor
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- name
- - type: object
- properties:
- type:
- type: string
- enum:
- - web_search_20250305
- name:
- type: string
- enum:
- - web_search
+ type: object
+ - properties:
allowed_domains:
- type: array
- nullable: true
items:
type: string
- blocked_domains:
- type: array
nullable: true
+ type: array
+ blocked_domains:
items:
type: string
+ nullable: true
+ type: array
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
type: integer
+ name:
+ enum:
+ - web_search
+ type: string
+ type:
+ enum:
+ - web_search_20250305
+ type: string
user_location:
$ref: '#/components/schemas/AnthropicWebSearchToolUserLocation'
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- name
- - type: object
- properties:
- type:
- type: string
- enum:
- - web_search_20260209
- name:
- type: string
- enum:
- - web_search
+ type: object
+ - properties:
allowed_callers:
- type: array
items:
- type: string
enum:
- direct
- code_execution_20250825
- code_execution_20260120
- allowed_domains:
+ type: string
type: array
- nullable: true
+ allowed_domains:
items:
type: string
- blocked_domains:
- type: array
nullable: true
+ type: array
+ blocked_domains:
items:
type: string
+ nullable: true
+ type: array
+ cache_control:
+ $ref: '#/components/schemas/AnthropicCacheControlDirective'
max_uses:
type: integer
+ name:
+ enum:
+ - web_search
+ type: string
+ type:
+ enum:
+ - web_search_20260209
+ type: string
user_location:
$ref: '#/components/schemas/AnthropicWebSearchToolUserLocation'
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
required:
- type
- name
+ type: object
- $ref: '#/components/schemas/DatetimeServerTool'
- $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
- tool_choice:
- oneOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - auto
- disable_parallel_tool_use:
- type: boolean
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - any
- disable_parallel_tool_use:
- type: boolean
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - none
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - tool
- name:
- type: string
- disable_parallel_tool_use:
- type: boolean
- required:
- - type
- - name
- thinking:
- oneOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - enabled
- budget_tokens:
- type: integer
- required:
- - type
- - budget_tokens
- - type: object
- properties:
- type:
- type: string
- enum:
- - disabled
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - adaptive
- required:
- - type
- service_tier:
- type: string
- enum:
- - auto
- - standard_only
- output_config:
- $ref: '#/components/schemas/MessagesOutputConfig'
- cache_control:
- $ref: '#/components/schemas/AnthropicCacheControlDirective'
- messages:
- type: array
- nullable: true
- items:
- $ref: '#/components/schemas/MessagesMessageParam'
- stream:
- type: boolean
- context_management:
- type: object
- nullable: true
- properties:
- edits:
- type: array
- items:
- oneOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - clear_tool_uses_20250919
- clear_at_least:
- $ref: '#/components/schemas/AnthropicInputTokensClearAtLeast'
- clear_tool_inputs:
- anyOf:
- - type: boolean
- - type: array
- items:
- type: string
- - nullable: true
- exclude_tools:
- type: array
- nullable: true
- items:
- type: string
- keep:
- $ref: '#/components/schemas/AnthropicToolUsesKeep'
- trigger:
- oneOf:
- - $ref: '#/components/schemas/AnthropicInputTokensTrigger'
- - $ref: '#/components/schemas/AnthropicToolUsesTrigger'
- discriminator:
- propertyName: type
- mapping:
- input_tokens: '#/components/schemas/AnthropicInputTokensTrigger'
- tool_uses: '#/components/schemas/AnthropicToolUsesTrigger'
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - clear_thinking_20251015
- keep:
- anyOf:
- - $ref: '#/components/schemas/AnthropicThinkingTurns'
- - type: object
- properties:
- type:
- type: string
- enum:
- - all
- required:
- - type
- - type: string
- enum:
- - all
- required:
- - type
- - type: object
- properties:
- type:
- type: string
- enum:
- - compact_20260112
- instructions:
- type: string
- nullable: true
- pause_after_compaction:
- type: boolean
- trigger:
- allOf:
- - $ref: '#/components/schemas/AnthropicInputTokensTrigger'
- - type: object
- nullable: true
- properties: {}
- example:
- type: input_tokens
- value: 100000
- required:
- - type
- provider:
- $ref: '#/components/schemas/ProviderPreferences'
- plugins:
type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/AutoRouterPlugin'
- - $ref: '#/components/schemas/ModerationPlugin'
- - $ref: '#/components/schemas/WebSearchPlugin'
- - $ref: '#/components/schemas/FileParserPlugin'
- - $ref: '#/components/schemas/ResponseHealingPlugin'
- - $ref: '#/components/schemas/ContextCompressionPlugin'
- discriminator:
- propertyName: id
- mapping:
- auto-router: '#/components/schemas/AutoRouterPlugin'
- moderation: '#/components/schemas/ModerationPlugin'
- web: '#/components/schemas/WebSearchPlugin'
- file-parser: '#/components/schemas/FileParserPlugin'
- response-healing: '#/components/schemas/ResponseHealingPlugin'
- context-compression: '#/components/schemas/ContextCompressionPlugin'
- description: Plugins you want to enable for this request, including their settings.
- route:
- $ref: '#/components/schemas/DeprecatedRoute'
+ top_k:
+ type: integer
+ top_p:
+ format: double
+ type: number
+ trace:
+ $ref: '#/components/schemas/TraceConfig'
user:
- type: string
- maxLength: 256
description: >-
A unique identifier representing your end-user, which helps distinguish between different users of your app.
This allows your app to identify specific users in case of abuse reports, preventing your entire app from
being affected by the actions of individual users. Maximum of 256 characters.
- session_id:
- type: string
maxLength: 256
- description: >-
- A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
- observability. If provided in both the request body and the x-session-id header, the body value takes
- precedence. Maximum of 256 characters.
- trace:
- $ref: '#/components/schemas/TraceConfig'
- models:
- type: array
- items:
- type: string
- speed:
- allOf:
- - $ref: '#/components/schemas/AnthropicSpeed'
- - example: fast
- description: >-
- Controls output generation speed. When set to `fast`, uses a higher-speed inference configuration at
- premium pricing. Defaults to `standard` when omitted.
+ type: string
required:
- model
- messages
- description: Request schema for Anthropic Messages API endpoint
- example:
- model: anthropic/claude-4.5-sonnet-20250929
- max_tokens: 1024
- messages:
- - role: user
- content: Hello, how are you?
- temperature: 0.7
- ActivityItem:
type: object
- properties:
- date:
- type: string
- description: Date of the activity (YYYY-MM-DD format)
- example: '2025-08-24'
- model:
- type: string
- description: Model slug (e.g., "openai/gpt-4.1")
- example: openai/gpt-4.1
- model_permaslug:
- type: string
- description: Model permaslug (e.g., "openai/gpt-4.1-2025-04-14")
- example: openai/gpt-4.1-2025-04-14
- endpoint_id:
- type: string
- description: Unique identifier for the endpoint
- example: 550e8400-e29b-41d4-a716-446655440000
- provider_name:
- type: string
- description: Name of the provider serving this endpoint
- example: OpenAI
+ MessagesResult:
+ allOf:
+ - $ref: '#/components/schemas/BaseMessagesResult'
+ - properties:
+ provider:
+ $ref: '#/components/schemas/ProviderName'
+ usage:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicUsage'
+ - properties:
+ cost:
+ format: double
+ type: number
+ cost_details:
+ nullable: true
+ properties:
+ upstream_inference_completions_cost:
+ format: double
+ type: number
+ upstream_inference_cost:
+ format: double
+ type: number
+ upstream_inference_prompt_cost:
+ format: double
+ type: number
+ required:
+ - upstream_inference_prompt_cost
+ - upstream_inference_completions_cost
+ type: object
+ is_byok:
+ type: boolean
+ iterations:
+ items:
+ $ref: '#/components/schemas/AnthropicUsageIteration'
+ type: array
+ service_tier:
+ nullable: true
+ type: string
+ speed:
+ $ref: '#/components/schemas/AnthropicSpeed'
+ type: object
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ inference_geo: null
+ input_tokens: 100
+ output_tokens: 50
+ server_tool_use: null
+ service_tier: standard
+ type: object
+ description: Non-streaming response from the Anthropic Messages API with OpenRouter extensions
+ example:
+ container: null
+ content:
+ - citations: null
+ text: Hello! I'm doing well, thank you for asking.
+ type: text
+ id: msg_01XFDUDYJgAACzvnptvVoYEL
+ model: claude-sonnet-4-5-20250929
+ role: assistant
+ stop_reason: end_turn
+ stop_sequence: null
+ type: message
usage:
- type: number
- format: double
- description: Total cost in USD (OpenRouter credits spent)
- example: 0.015
- byok_usage_inference:
- type: number
- format: double
- description: BYOK inference cost in USD (external credits spent)
- example: 0.012
- requests:
- type: integer
- description: Number of requests made
- example: 5
- prompt_tokens:
- type: integer
- description: Total prompt tokens used
- example: 50
- completion_tokens:
- type: integer
- description: Total completion tokens generated
- example: 125
- reasoning_tokens:
- type: integer
- description: Total reasoning tokens used
- example: 25
- required:
- - date
- - model
- - model_permaslug
- - endpoint_id
- - provider_name
- - usage
- - byok_usage_inference
- - requests
- - prompt_tokens
- - completion_tokens
- - reasoning_tokens
- example:
- date: '2025-08-24'
- model: openai/gpt-4.1
- model_permaslug: openai/gpt-4.1-2025-04-14
- endpoint_id: 550e8400-e29b-41d4-a716-446655440000
- provider_name: OpenAI
- usage: 0.015
- byok_usage_inference: 0.012
- requests: 5
- prompt_tokens: 50
- completion_tokens: 125
- reasoning_tokens: 25
- ActivityResponse:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/ActivityItem'
- description: List of activity items
- required:
- - data
+ cache_creation: null
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ inference_geo: null
+ input_tokens: 12
+ output_tokens: 15
+ server_tool_use: null
+ service_tier: standard
+ MessagesStartEvent:
+ description: Event sent at the start of a streaming message
example:
- data:
- - date: '2025-08-24'
- model: openai/gpt-4.1
- model_permaslug: openai/gpt-4.1-2025-04-14
- endpoint_id: 550e8400-e29b-41d4-a716-446655440000
- provider_name: OpenAI
- usage: 0.015
- byok_usage_inference: 0.012
- requests: 5
- prompt_tokens: 50
- completion_tokens: 125
- reasoning_tokens: 25
- ForbiddenResponseErrorData:
- type: object
+ message:
+ content: []
+ id: msg_01XFDUDYJgAACzvnptvVoYEL
+ model: claude-sonnet-4-5-20250929
+ role: assistant
+ stop_reason: null
+ stop_sequence: null
+ type: message
+ usage:
+ input_tokens: 12
+ output_tokens: 0
+ type: message_start
properties:
- code:
- type: integer
message:
- type: string
- metadata:
+ properties:
+ container:
+ $ref: '#/components/schemas/AnthropicContainer'
+ content:
+ items:
+ $ref: '#/components/schemas/ORAnthropicContentBlock'
+ type: array
+ id:
+ type: string
+ model:
+ type: string
+ provider:
+ enum:
+ - AnyScale
+ - Atoma
+ - Cent-ML
+ - CrofAI
+ - Enfer
+ - GoPomelo
+ - HuggingFace
+ - Hyperbolic 2
+ - InoCloud
+ - Kluster
+ - Lambda
+ - Lepton
+ - Lynn 2
+ - Lynn
+ - Mancer
+ - Meta
+ - Modal
+ - Nineteen
+ - OctoAI
+ - Recursal
+ - Reflection
+ - Replicate
+ - SambaNova 2
+ - SF Compute
+ - Targon
+ - Together 2
+ - Ubicloud
+ - 01.AI
+ - AkashML
+ - AI21
+ - AionLabs
+ - Alibaba
+ - Ambient
+ - Amazon Bedrock
+ - Amazon Nova
+ - Anthropic
+ - Arcee AI
+ - AtlasCloud
+ - Avian
+ - Azure
+ - BaseTen
+ - BytePlus
+ - Black Forest Labs
+ - Cerebras
+ - Chutes
+ - Cirrascale
+ - Clarifai
+ - Cloudflare
+ - Cohere
+ - Crusoe
+ - DeepInfra
+ - DeepSeek
+ - Featherless
+ - Fireworks
+ - Friendli
+ - GMICloud
+ - Google
+ - Google AI Studio
+ - Groq
+ - Hyperbolic
+ - Inception
+ - Inceptron
+ - InferenceNet
+ - Ionstream
+ - Infermatic
+ - Io Net
+ - Inflection
+ - Liquid
+ - Mara
+ - Mancer 2
+ - Minimax
+ - ModelRun
+ - Mistral
+ - Modular
+ - Moonshot AI
+ - Morph
+ - NCompass
+ - Nebius
+ - NextBit
+ - Novita
+ - Nvidia
+ - OpenAI
+ - OpenInference
+ - Parasail
+ - Perplexity
+ - Phala
+ - Reka
+ - Relace
+ - SambaNova
+ - Seed
+ - SiliconFlow
+ - Sourceful
+ - StepFun
+ - Stealth
+ - StreamLake
+ - Switchpoint
+ - Together
+ - Upstage
+ - Venice
+ - WandB
+ - Xiaomi
+ - xAI
+ - Z.AI
+ - FakeProvider
+ type: string
+ role:
+ enum:
+ - assistant
+ type: string
+ stop_reason:
+ nullable: true
+ stop_sequence:
+ nullable: true
+ type:
+ enum:
+ - message
+ type: string
+ usage:
+ allOf:
+ - $ref: '#/components/schemas/AnthropicUsage'
+ - properties:
+ iterations:
+ items:
+ $ref: '#/components/schemas/AnthropicUsageIteration'
+ type: array
+ speed:
+ $ref: '#/components/schemas/AnthropicSpeed'
+ type: object
+ example:
+ cache_creation: null
+ cache_creation_input_tokens: null
+ cache_read_input_tokens: null
+ inference_geo: null
+ input_tokens: 100
+ output_tokens: 50
+ server_tool_use: null
+ service_tier: standard
+ required:
+ - id
+ - type
+ - role
+ - container
+ - content
+ - model
+ - stop_reason
+ - stop_sequence
+ - usage
type: object
- nullable: true
- additionalProperties:
- nullable: true
+ type:
+ enum:
+ - message_start
+ type: string
required:
- - code
+ - type
- message
- description: Error data for ForbiddenResponse
- example:
- code: 403
- message: Only management keys can perform this operation
- ForbiddenResponse:
- type: object
- properties:
- error:
- $ref: '#/components/schemas/ForbiddenResponseErrorData'
- user_id:
- type: string
- nullable: true
- required:
- - error
- description: Forbidden - Authentication successful but insufficient permissions
- example:
- error:
- code: 403
- message: Only management keys can perform this operation
- ChatFinishReasonEnum:
- type: string
- nullable: true
- enum:
- - tool_calls
- - stop
- - length
- - content_filter
- - error
- - null
- example: stop
- ChatContentCacheControl:
- allOf:
- - $ref: '#/components/schemas/AnthropicCacheControlDirective'
- - type: object
- properties: {}
- example:
- type: ephemeral
- ttl: 5m
- description: Cache control for the content part
- ChatContentText:
type: object
+ MessagesStopEvent:
+ description: Event sent when the message is complete
+ example:
+ type: message_stop
properties:
type:
- type: string
enum:
- - text
- text:
+ - message_stop
type: string
- cache_control:
- $ref: '#/components/schemas/ChatContentCacheControl'
required:
- type
- - text
- description: Text content part
- example:
- type: text
- text: Hello, world!
- ChatContentImage:
type: object
- properties:
- type:
- type: string
- enum:
- - image_url
- image_url:
- type: object
- properties:
- url:
- type: string
- description: 'URL of the image (data: URLs supported)'
- detail:
- type: string
- enum:
- - auto
- - low
- - high
- description: Image detail level for vision models
- required:
- - url
- required:
- - type
- - image_url
- description: Image content part for vision models
+ MessagesStreamEvents:
+ description: Union of all possible streaming events
+ discriminator:
+ mapping:
+ content_block_delta: '#/components/schemas/MessagesContentBlockDeltaEvent'
+ content_block_start: '#/components/schemas/MessagesContentBlockStartEvent'
+ content_block_stop: '#/components/schemas/MessagesContentBlockStopEvent'
+ error: '#/components/schemas/MessagesErrorEvent'
+ message_delta: '#/components/schemas/MessagesDeltaEvent'
+ message_start: '#/components/schemas/MessagesStartEvent'
+ message_stop: '#/components/schemas/MessagesStopEvent'
+ ping: '#/components/schemas/MessagesPingEvent'
+ propertyName: type
example:
- type: image_url
- image_url:
- url: https://example.com/image.jpg
- detail: auto
- ChatContentAudio:
- type: object
- properties:
- type:
- type: string
- enum:
- - input_audio
- input_audio:
- type: object
- properties:
- data:
- type: string
- description: Base64 encoded audio data
- format:
- type: string
- description: >-
- Audio format (e.g., wav, mp3, flac, m4a, ogg, aiff, aac, pcm16, pcm24). Supported formats vary by
- provider.
- required:
- - data
- - format
- required:
- - type
- - input_audio
- description: Audio input content part. Supported audio formats vary by provider.
+ delta:
+ text: Hello
+ type: text_delta
+ index: 0
+ type: content_block_delta
+ oneOf:
+ - $ref: '#/components/schemas/MessagesStartEvent'
+ - $ref: '#/components/schemas/MessagesDeltaEvent'
+ - $ref: '#/components/schemas/MessagesStopEvent'
+ - $ref: '#/components/schemas/MessagesContentBlockStartEvent'
+ - $ref: '#/components/schemas/MessagesContentBlockDeltaEvent'
+ - $ref: '#/components/schemas/MessagesContentBlockStopEvent'
+ - $ref: '#/components/schemas/MessagesPingEvent'
+ - $ref: '#/components/schemas/MessagesErrorEvent'
+ Model:
+ description: Information about an AI model available on OpenRouter
example:
- type: input_audio
- input_audio:
- data: SGVsbG8gV29ybGQ=
- format: wav
- Legacy_ChatContentVideo:
- type: object
+ architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ canonical_slug: openai/gpt-4
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ expiration_date: null
+ id: openai/gpt-4
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
+ name: GPT-4
+ per_request_limits: null
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ top_provider:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
properties:
- type:
+ architecture:
+ $ref: '#/components/schemas/ModelArchitecture'
+ canonical_slug:
+ description: Canonical slug for the model
+ example: openai/gpt-4
type: string
- enum:
- - input_video
- video_url:
- $ref: '#/components/schemas/ChatContentVideoInput'
- required:
- - type
- - video_url
- description: Video input content part (legacy format - deprecated)
- deprecated: true
- example:
- type: input_video
- video_url:
- url: https://example.com/video.mp4
- ChatContentVideoInput:
- type: object
- properties:
- url:
+ context_length:
+ description: Maximum context length in tokens
+ example: 8192
+ type: integer
+ created:
+ description: Unix timestamp of when the model was created
+ example: 1692901234
+ type: integer
+ default_parameters:
+ $ref: '#/components/schemas/DefaultParameters'
+ description:
+ description: Description of the model
+ example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
type: string
- description: 'URL of the video (data: URLs supported)'
- required:
- - url
- description: Video input object
- example:
- url: https://example.com/video.mp4
- ChatContentVideo:
- type: object
- properties:
- type:
+ expiration_date:
+ description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.
+ example: '2025-06-01'
+ nullable: true
type: string
- enum:
- - video_url
- video_url:
- $ref: '#/components/schemas/ChatContentVideoInput'
- required:
- - type
- - video_url
- description: Video input content part
- example:
- type: video_url
- video_url:
- url: https://example.com/video.mp4
- ChatContentFile:
- type: object
- properties:
- type:
+ hugging_face_id:
+ description: Hugging Face model identifier, if applicable
+ example: microsoft/DialoGPT-medium
+ nullable: true
type: string
- enum:
- - file
- file:
- type: object
- properties:
- file_data:
- type: string
- description: File content as base64 data URL or URL
- file_id:
- type: string
- description: File ID for previously uploaded files
- filename:
- type: string
- description: Original filename
- required:
- - type
- - file
- description: File content part for document processing
- example:
- type: file
- file:
- file_data: https://example.com/document.pdf
- filename: document.pdf
- ChatContentItems:
- oneOf:
- - $ref: '#/components/schemas/ChatContentText'
- - $ref: '#/components/schemas/ChatContentImage'
- - $ref: '#/components/schemas/ChatContentAudio'
- - $ref: '#/components/schemas/Legacy_ChatContentVideo'
- - $ref: '#/components/schemas/ChatContentVideo'
- - $ref: '#/components/schemas/ChatContentFile'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/ChatContentText'
- image_url: '#/components/schemas/ChatContentImage'
- input_audio: '#/components/schemas/ChatContentAudio'
- input_video: '#/components/schemas/Legacy_ChatContentVideo'
- video_url: '#/components/schemas/ChatContentVideo'
- file: '#/components/schemas/ChatContentFile'
- description: Content part for chat completion messages
- example:
- type: text
- text: Hello, world!
- ChatToolCall:
- type: object
- properties:
id:
+ description: Unique identifier for the model
+ example: openai/gpt-4
type: string
- description: Tool call identifier
- type:
+ knowledge_cutoff:
+ description: The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.
+ example: '2024-10-01'
+ nullable: true
type: string
- enum:
- - function
- function:
- type: object
- properties:
- name:
- type: string
- description: Function name to call
- arguments:
- type: string
- description: Function arguments as JSON string
- required:
- - name
- - arguments
+ links:
+ $ref: '#/components/schemas/ModelLinks'
+ name:
+ description: Display name of the model
+ example: GPT-4
+ type: string
+ per_request_limits:
+ $ref: '#/components/schemas/PerRequestLimits'
+ pricing:
+ $ref: '#/components/schemas/PublicPricing'
+ supported_parameters:
+ description: List of supported parameters for this model
+ items:
+ $ref: '#/components/schemas/Parameter'
+ type: array
+ top_provider:
+ $ref: '#/components/schemas/TopProviderInfo'
required:
- id
- - type
- - function
- description: Tool call made by the assistant
- example:
- id: call_abc123
- type: function
- function:
- name: get_current_weather
- arguments: '{"location": "Boston, MA"}'
- ReasoningDetailSummary:
+ - canonical_slug
+ - name
+ - created
+ - pricing
+ - context_length
+ - architecture
+ - top_provider
+ - per_request_limits
+ - supported_parameters
+ - default_parameters
+ - links
type: object
+ ModelArchitecture:
+ description: Model architecture information
+ example:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
properties:
- type:
- type: string
+ input_modalities:
+ description: Supported input modalities
+ items:
+ $ref: '#/components/schemas/InputModality'
+ type: array
+ instruct_type:
+ description: Instruction format type
enum:
- - reasoning.summary
- summary:
- type: string
- id:
+ - none
+ - airoboros
+ - alpaca
+ - alpaca-modif
+ - chatml
+ - claude
+ - code-llama
+ - gemma
+ - llama2
+ - llama3
+ - mistral
+ - nemotron
+ - neural
+ - openchat
+ - phi3
+ - rwkv
+ - vicuna
+ - zephyr
+ - deepseek-r1
+ - deepseek-v3.1
+ - qwq
+ - qwen3
+ - null
+ example: chatml
+ nullable: true
type: string
+ modality:
+ description: Primary modality of the model
+ example: text->text
nullable: true
- format:
- $ref: '#/components/schemas/ReasoningFormat'
- index:
- type: integer
+ type: string
+ output_modalities:
+ description: Supported output modalities
+ items:
+ $ref: '#/components/schemas/OutputModality'
+ type: array
+ tokenizer:
+ $ref: '#/components/schemas/ModelGroup'
required:
- - type
- - summary
- description: Reasoning detail summary schema
- example:
- type: reasoning.summary
- summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
- ReasoningDetailEncrypted:
+ - modality
+ - input_modalities
+ - output_modalities
type: object
+ ModelGroup:
+ description: Tokenizer type used by the model
+ enum:
+ - Router
+ - Media
+ - Other
+ - GPT
+ - Claude
+ - Gemini
+ - Gemma
+ - Grok
+ - Cohere
+ - Nova
+ - Qwen
+ - Yi
+ - DeepSeek
+ - Mistral
+ - Llama2
+ - Llama3
+ - Llama4
+ - PaLM
+ - RWKV
+ - Qwen3
+ example: GPT
+ type: string
+ ModelLinks:
+ description: Related API endpoints and resources for this model.
+ example:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
properties:
- type:
- type: string
- enum:
- - reasoning.encrypted
- data:
- type: string
- id:
+ details:
+ description: URL for the model details/endpoints API
+ example: /api/v1/models/openai/gpt-5.4/endpoints
type: string
- nullable: true
- format:
- $ref: '#/components/schemas/ReasoningFormat'
- index:
- type: integer
required:
- - type
- - data
- description: Reasoning detail encrypted schema
- example:
- type: reasoning.encrypted
- data: encrypted data
- ReasoningDetailText:
+ - details
type: object
+ ModelName:
+ description: Model to use for completion
+ example: openai/gpt-4
+ type: string
+ ModelsCountResponse:
+ description: Model count data
+ example:
+ data:
+ count: 150
properties:
- type:
- type: string
- enum:
- - reasoning.text
- text:
- type: string
- nullable: true
- signature:
- type: string
- nullable: true
- id:
- type: string
- nullable: true
- format:
- $ref: '#/components/schemas/ReasoningFormat'
- index:
- type: integer
+ data:
+ description: Model count data
+ example:
+ count: 150
+ properties:
+ count:
+ description: Total number of available models
+ example: 150
+ type: integer
+ required:
+ - count
+ type: object
required:
- - type
- description: Reasoning detail text schema
+ - data
+ type: object
+ ModelsListResponse:
+ description: List of available models
example:
- type: reasoning.text
- text: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
- signature: signature
- ReasoningDetailUnion:
- oneOf:
- - $ref: '#/components/schemas/ReasoningDetailSummary'
- - $ref: '#/components/schemas/ReasoningDetailEncrypted'
- - $ref: '#/components/schemas/ReasoningDetailText'
- discriminator:
- propertyName: type
- mapping:
- reasoning.summary: '#/components/schemas/ReasoningDetailSummary'
- reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted'
- reasoning.text: '#/components/schemas/ReasoningDetailText'
- description: Reasoning detail union schema
+ data:
+ - architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ canonical_slug: openai/gpt-4
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ expiration_date: null
+ id: openai/gpt-4
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
+ name: GPT-4
+ per_request_limits: null
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ - frequency_penalty
+ - presence_penalty
+ top_provider:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
+ properties:
+ data:
+ $ref: '#/components/schemas/ModelsListResponseData'
+ required:
+ - data
+ type: object
+ ModelsListResponseData:
+ description: List of available models
example:
- type: reasoning.summary
- summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
- ChatReasoningDetails:
- type: array
+ - architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ canonical_slug: openai/gpt-4
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ expiration_date: null
+ id: openai/gpt-4
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
+ name: GPT-4
+ per_request_limits: null
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ top_provider:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
items:
- $ref: '#/components/schemas/ReasoningDetailUnion'
- description: Reasoning details for extended thinking models
- example:
- - type: thinking
- thinking: Let me work through this step by step...
- ChatAssistantImages:
+ $ref: '#/components/schemas/Model'
type: array
- items:
- type: object
- properties:
- image_url:
- type: object
- properties:
- url:
- type: string
- description: URL or base64-encoded data of the generated image
- required:
- - url
- required:
- - image_url
- description: Generated images from image generation models
+ ModerationPlugin:
example:
- - image_url:
- url: data:image/png;base64,iVBORw0KGgo...
- ChatAudioOutput:
- type: object
+ id: moderation
properties:
id:
+ enum:
+ - moderation
type: string
- description: Audio output identifier
- expires_at:
- type: integer
- description: Audio expiration timestamp
- data:
- type: string
- description: Base64 encoded audio data
- transcript:
+ required:
+ - id
+ type: object
+ NotFoundResponse:
+ description: Not Found - Resource does not exist
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ properties:
+ error:
+ $ref: '#/components/schemas/NotFoundResponseErrorData'
+ user_id:
+ nullable: true
type: string
- description: Audio transcript
- description: Audio output data or reference
+ required:
+ - error
+ type: object
+ NotFoundResponseErrorData:
+ description: Error data for NotFoundResponse
example:
- id: audio_abc123
- expires_at: 1677652400
- data: UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f
- transcript: Hello! How can I help you today?
- ChatAssistantMessage:
+ code: 404
+ message: Resource not found
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
type: object
+ OpenAIResponseFunctionToolCall:
+ example:
+ arguments: '{"location":"San Francisco"}'
+ call_id: call-abc123
+ id: fc-abc123
+ name: get_weather
+ status: completed
+ type: function_call
properties:
- role:
+ arguments:
type: string
- enum:
- - assistant
- content:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/ChatContentItems'
- - nullable: true
- description: Assistant message content
- name:
+ call_id:
type: string
- description: Optional name for the assistant
- tool_calls:
- type: array
- items:
- $ref: '#/components/schemas/ChatToolCall'
- description: Tool calls made by the assistant
- refusal:
+ id:
type: string
- nullable: true
- description: Refusal message if content was refused
- reasoning:
+ name:
+ type: string
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ type:
+ enum:
+ - function_call
type: string
- nullable: true
- description: Reasoning output
- reasoning_details:
- $ref: '#/components/schemas/ChatReasoningDetails'
- images:
- $ref: '#/components/schemas/ChatAssistantImages'
- audio:
- $ref: '#/components/schemas/ChatAudioOutput'
required:
- - role
- description: Assistant message for requests and responses
- example:
- role: assistant
- content: The capital of France is Paris.
- ChatTokenLogprob:
+ - type
+ - call_id
+ - name
+ - arguments
type: object
+ OpenAIResponseFunctionToolCallOutput:
+ example:
+ call_id: call-abc123
+ output: '{"temperature":72,"conditions":"sunny"}'
+ type: function_call_output
properties:
- token:
+ call_id:
type: string
- description: The token
- logprob:
- type: number
- format: double
- description: Log probability of the token
- bytes:
- type: array
+ id:
nullable: true
- items:
- type: integer
- description: UTF-8 bytes of the token
- top_logprobs:
- type: array
- items:
- type: object
- properties:
- token:
- type: string
- logprob:
- type: number
- format: double
- bytes:
- type: array
- nullable: true
- items:
- type: integer
- required:
- - token
- - logprob
- - bytes
- description: Top alternative tokens with probabilities
+ type: string
+ output:
+ anyOf:
+ - type: string
+ - items:
+ discriminator:
+ mapping:
+ input_file: '#/components/schemas/InputFile'
+ input_image: '#/components/schemas/InputImage'
+ input_text: '#/components/schemas/InputText'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - $ref: '#/components/schemas/InputImage'
+ - $ref: '#/components/schemas/InputFile'
+ type: array
+ status:
+ allOf:
+ - $ref: '#/components/schemas/ToolCallStatus'
+ - nullable: true
+ type:
+ enum:
+ - function_call_output
+ type: string
required:
- - token
- - logprob
- - bytes
- - top_logprobs
- description: Token log probability information
- example:
- token: ' Hello'
- logprob: -0.612345
- bytes: null
- top_logprobs:
- - token: ' Hello'
- logprob: -0.612345
- bytes: null
- ChatTokenLogprobs:
+ - type
+ - call_id
+ - output
type: object
- nullable: true
+ OpenAIResponseInputMessageItem:
+ example:
+ content:
+ - text: Hello, how are you?
+ type: input_text
+ id: msg-abc123
+ role: user
+ type: message
properties:
content:
- type: array
- nullable: true
items:
- $ref: '#/components/schemas/ChatTokenLogprob'
- description: Log probabilities for content tokens
- refusal:
+ discriminator:
+ mapping:
+ input_audio: '#/components/schemas/InputAudio'
+ input_file: '#/components/schemas/InputFile'
+ input_image: '#/components/schemas/InputImage'
+ input_text: '#/components/schemas/InputText'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/InputText'
+ - $ref: '#/components/schemas/InputImage'
+ - $ref: '#/components/schemas/InputFile'
+ - $ref: '#/components/schemas/InputAudio'
type: array
- nullable: true
- items:
- $ref: '#/components/schemas/ChatTokenLogprob'
- description: Log probabilities for refusal tokens
+ id:
+ type: string
+ role:
+ anyOf:
+ - enum:
+ - user
+ type: string
+ - enum:
+ - system
+ type: string
+ - enum:
+ - developer
+ type: string
+ type:
+ enum:
+ - message
+ type: string
required:
+ - id
+ - role
- content
- description: Log probabilities for the completion
- example:
- content:
- - token: ' Hello'
- logprob: -0.612345
- bytes: null
- top_logprobs: []
- refusal: null
- ChatChoice:
type: object
- properties:
- finish_reason:
- $ref: '#/components/schemas/ChatFinishReasonEnum'
- index:
- type: integer
- description: Choice index
- example: 0
- message:
- $ref: '#/components/schemas/ChatAssistantMessage'
- logprobs:
- $ref: '#/components/schemas/ChatTokenLogprobs'
- required:
- - finish_reason
- - index
- - message
- description: Chat completion choice
+ OpenAIResponsesAnnotation:
+ anyOf:
+ - $ref: '#/components/schemas/FileCitation'
+ - $ref: '#/components/schemas/URLCitation'
+ - $ref: '#/components/schemas/FilePath'
example:
- finish_reason: stop
+ file_id: file-abc123
+ filename: research_paper.pdf
index: 0
- message:
- role: assistant
- content: The capital of France is Paris.
- logprobs: null
- ChatUsage:
- type: object
+ type: file_citation
+ OpenAIResponsesImageGenCallCompleted:
+ example:
+ item_id: ig_abc123
+ output_index: 0
+ sequence_number: 4
+ type: response.image_generation_call.completed
properties:
- completion_tokens:
- type: integer
- description: Number of tokens in the completion
- prompt_tokens:
+ item_id:
+ type: string
+ output_index:
type: integer
- description: Number of tokens in the prompt
- total_tokens:
+ sequence_number:
type: integer
- description: Total number of tokens
- completion_tokens_details:
- type: object
- nullable: true
- properties:
- reasoning_tokens:
- type: integer
- description: Tokens used for reasoning
- audio_tokens:
- type: integer
- description: Tokens used for audio output
- accepted_prediction_tokens:
- type: integer
- description: Accepted prediction tokens
- rejected_prediction_tokens:
- type: integer
- description: Rejected prediction tokens
- description: Detailed completion token usage
- prompt_tokens_details:
- type: object
- nullable: true
- properties:
- cached_tokens:
- type: integer
- description: Cached prompt tokens
- cache_write_tokens:
- type: integer
- description: Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
- audio_tokens:
- type: integer
- description: Audio input tokens
- video_tokens:
- type: integer
- description: Video input tokens
- description: Detailed prompt token usage
+ type:
+ enum:
+ - response.image_generation_call.completed
+ type: string
required:
- - completion_tokens
- - prompt_tokens
- - total_tokens
- description: Token usage statistics
- example:
- completion_tokens: 15
- prompt_tokens: 10
- total_tokens: 25
- completion_tokens_details:
- reasoning_tokens: 5
- prompt_tokens_details:
- cached_tokens: 2
- ChatResult:
+ - type
+ - item_id
+ - output_index
+ - sequence_number
type: object
+ OpenAIResponsesImageGenCallGenerating:
+ example:
+ item_id: ig_abc123
+ output_index: 0
+ sequence_number: 2
+ type: response.image_generation_call.generating
properties:
- id:
+ item_id:
type: string
- description: Unique completion identifier
- example: chatcmpl-123
- choices:
- type: array
- items:
- $ref: '#/components/schemas/ChatChoice'
- description: List of completion choices
- created:
+ output_index:
type: integer
- description: Unix timestamp of creation
- example: 1677652288
- model:
- type: string
- description: Model used for completion
- example: openai/gpt-4
- object:
- type: string
+ sequence_number:
+ type: integer
+ type:
enum:
- - chat.completion
- system_fingerprint:
- type: string
- nullable: true
- description: System fingerprint
- example: fp_44709d6fcb
- service_tier:
+ - response.image_generation_call.generating
type: string
- nullable: true
- description: The service tier used by the upstream provider for this request
- example: default
- usage:
- $ref: '#/components/schemas/ChatUsage'
required:
- - id
- - choices
- - created
- - model
- - object
- - system_fingerprint
- description: Chat completion response
+ - type
+ - item_id
+ - output_index
+ - sequence_number
+ type: object
+ OpenAIResponsesImageGenCallInProgress:
example:
- id: chatcmpl-123
- object: chat.completion
- created: 1677652288
- model: openai/gpt-4
- choices:
- - index: 0
- message:
- role: assistant
- content: The capital of France is Paris.
- finish_reason: stop
- usage:
- prompt_tokens: 10
- completion_tokens: 15
- total_tokens: 25
- ChatStreamToolCall:
- type: object
+ item_id: ig_abc123
+ output_index: 0
+ sequence_number: 1
+ type: response.image_generation_call.in_progress
properties:
- index:
- type: integer
- description: Tool call index in the array
- example: 0
- id:
+ item_id:
type: string
- description: Tool call identifier
- example: call_abc123
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
type:
- type: string
enum:
- - function
- description: Tool call type
- example: function
- function:
- type: object
- properties:
- name:
- type: string
- description: Function name
- example: get_weather
- arguments:
- type: string
- description: Function arguments as JSON string
- example: '{"location": "..."}'
- description: Function call details
+ - response.image_generation_call.in_progress
+ type: string
required:
- - index
- description: Tool call delta for streaming responses
- example:
- index: 0
- id: call_abc123
- type: function
- function:
- name: get_weather
- arguments: '{"location": "..."}'
- ChatStreamReasoningDetails:
- type: array
- items:
- $ref: '#/components/schemas/ReasoningDetailUnion'
- description: Reasoning details for extended thinking models
- example:
- - type: text
- text: Let me think about this...
- ChatStreamDelta:
+ - type
+ - item_id
+ - output_index
+ - sequence_number
type: object
+ OpenAIResponsesImageGenCallPartialImage:
+ example:
+ item_id: ig_abc123
+ output_index: 0
+ partial_image_b64: iVBORw0KGgo...
+ partial_image_index: 0
+ sequence_number: 3
+ type: response.image_generation_call.partial_image
properties:
- role:
- type: string
- enum:
- - assistant
- description: The role of the message author
- example: assistant
- content:
- type: string
- nullable: true
- description: Message content delta
- example: Hello
- reasoning:
+ item_id:
type: string
- nullable: true
- description: Reasoning content delta
- example: I need to
- refusal:
+ output_index:
+ type: integer
+ partial_image_b64:
type: string
- nullable: true
- description: Refusal message delta
- example: null
- tool_calls:
- type: array
- items:
- $ref: '#/components/schemas/ChatStreamToolCall'
- description: Tool calls delta
- reasoning_details:
- $ref: '#/components/schemas/ChatStreamReasoningDetails'
- audio:
- allOf:
- - $ref: '#/components/schemas/ChatAudioOutput'
- - description: Audio output data
- description: Delta changes in streaming response
- example:
- role: assistant
- content: Hello
- ChatStreamChoice:
- type: object
- properties:
- delta:
- $ref: '#/components/schemas/ChatStreamDelta'
- finish_reason:
- $ref: '#/components/schemas/ChatFinishReasonEnum'
- index:
+ partial_image_index:
type: integer
- description: Choice index
- example: 0
- logprobs:
- $ref: '#/components/schemas/ChatTokenLogprobs'
+ sequence_number:
+ type: integer
+ type:
+ enum:
+ - response.image_generation_call.partial_image
+ type: string
required:
- - delta
- - finish_reason
- - index
- description: Streaming completion choice chunk
- example:
- index: 0
- delta:
- role: assistant
- content: Hello
- finish_reason: null
- ChatStreamChunk:
+ - type
+ - item_id
+ - output_index
+ - sequence_number
+ - partial_image_b64
+ - partial_image_index
type: object
+ OpenAIResponsesRefusalContent:
+ example:
+ refusal: I'm sorry, I cannot assist with that request
+ type: refusal
properties:
- id:
- type: string
- description: Unique chunk identifier
- example: chatcmpl-123
- choices:
- type: array
- items:
- $ref: '#/components/schemas/ChatStreamChoice'
- description: List of streaming chunk choices
- created:
- type: integer
- description: Unix timestamp of creation
- example: 1677652288
- model:
- type: string
- description: Model used for completion
- example: openai/gpt-4
- object:
+ refusal:
type: string
+ type:
enum:
- - chat.completion.chunk
- system_fingerprint:
- type: string
- description: System fingerprint
- example: fp_44709d6fcb
- service_tier:
+ - refusal
type: string
- nullable: true
- description: The service tier used by the upstream provider for this request
- example: default
- error:
- type: object
- properties:
- message:
- type: string
- description: Error message
- example: Rate limit exceeded
- code:
- type: integer
- format: int32
- description: Error code
- example: 429
- required:
- - message
- - code
- description: Error information
- example:
- message: Rate limit exceeded
- code: 429
- usage:
- $ref: '#/components/schemas/ChatUsage'
required:
- - id
- - choices
- - created
- - model
- - object
- description: Streaming chat completion chunk
- x-speakeasy-entity: ChatStreamChunk
- example:
- id: chatcmpl-123
- object: chat.completion.chunk
- created: 1677652288
- model: openai/gpt-4
- choices:
- - index: 0
- delta:
- role: assistant
- content: Hello
- finish_reason: null
- ChatSystemMessage:
+ - type
+ - refusal
type: object
+ OpenAIResponsesResponseStatus:
+ enum:
+ - completed
+ - incomplete
+ - in_progress
+ - failed
+ - cancelled
+ - queued
+ example: completed
+ type: string
+ OpenAIResponsesSearchCompleted:
+ example:
+ item_id: ws_abc123
+ output_index: 0
+ sequence_number: 5
+ type: response.web_search_call.completed
properties:
- role:
+ item_id:
type: string
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
+ type:
enum:
- - system
- content:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/ChatContentText'
- description: System message content
- example: You are a helpful assistant.
- name:
+ - response.web_search_call.completed
type: string
- description: Optional name for the system message
- example: Assistant Config
required:
- - role
- - content
- description: System message for setting behavior
- example:
- role: system
- content: You are a helpful assistant.
- name: Assistant Config
- ChatUserMessage:
+ - type
+ - item_id
+ - output_index
+ - sequence_number
type: object
- properties:
- role:
+ OpenAIResponsesToolChoice:
+ anyOf:
+ - enum:
+ - auto
type: string
- enum:
- - user
- content:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/ChatContentItems'
- description: User message content
- example: What is the capital of France?
- name:
+ - enum:
+ - none
type: string
- description: Optional name for the user
- example: User
- required:
- - role
- - content
- description: User message
+ - enum:
+ - required
+ type: string
+ - properties:
+ name:
+ type: string
+ type:
+ enum:
+ - function
+ type: string
+ required:
+ - type
+ - name
+ type: object
+ - properties:
+ type:
+ anyOf:
+ - enum:
+ - web_search_preview_2025_03_11
+ type: string
+ - enum:
+ - web_search_preview
+ type: string
+ required:
+ - type
+ type: object
+ - $ref: '#/components/schemas/ToolChoiceAllowed'
+ example: auto
+ OpenAIResponsesTruncation:
+ enum:
+ - auto
+ - disabled
+ - null
+ example: auto
+ nullable: true
+ type: string
+ OpenAIResponsesUsage:
example:
- role: user
- content: What is the capital of France?
- ChatDeveloperMessage:
- type: object
+ input_tokens: 100
+ input_tokens_details:
+ cached_tokens: 0
+ output_tokens: 50
+ output_tokens_details:
+ reasoning_tokens: 0
+ total_tokens: 150
properties:
- role:
- type: string
- enum:
- - developer
- content:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/ChatContentText'
- description: Developer message content
- example: This is a message from the developer.
- name:
- type: string
- description: Optional name for the developer message
- example: Developer
+ input_tokens:
+ type: integer
+ input_tokens_details:
+ properties:
+ cached_tokens:
+ type: integer
+ required:
+ - cached_tokens
+ type: object
+ output_tokens:
+ type: integer
+ output_tokens_details:
+ properties:
+ reasoning_tokens:
+ type: integer
+ required:
+ - reasoning_tokens
+ type: object
+ total_tokens:
+ type: integer
required:
- - role
- - content
- description: Developer message
- example:
- role: developer
- content: This is a message from the developer.
- ChatToolMessage:
+ - input_tokens
+ - input_tokens_details
+ - output_tokens
+ - output_tokens_details
+ - total_tokens
type: object
+ OpenAIResponsesWebSearchCallInProgress:
+ example:
+ item_id: ws_abc123
+ output_index: 0
+ sequence_number: 1
+ type: response.web_search_call.in_progress
properties:
- role:
+ item_id:
type: string
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
+ type:
enum:
- - tool
- content:
- anyOf:
- - type: string
- - type: array
- items:
- $ref: '#/components/schemas/ChatContentItems'
- description: Tool response content
- example: The weather in San Francisco is 72°F and sunny.
- tool_call_id:
+ - response.web_search_call.in_progress
type: string
- description: ID of the assistant message tool call this message responds to
- example: call_abc123
required:
- - role
- - content
- - tool_call_id
- description: Tool response message
- example:
- role: tool
- content: The weather in San Francisco is 72°F and sunny.
- tool_call_id: call_abc123
- ChatMessages:
- oneOf:
- - $ref: '#/components/schemas/ChatSystemMessage'
- - $ref: '#/components/schemas/ChatUserMessage'
- - $ref: '#/components/schemas/ChatDeveloperMessage'
- - $ref: '#/components/schemas/ChatAssistantMessage'
- - $ref: '#/components/schemas/ChatToolMessage'
- discriminator:
- propertyName: role
- mapping:
- system: '#/components/schemas/ChatSystemMessage'
- user: '#/components/schemas/ChatUserMessage'
- developer: '#/components/schemas/ChatDeveloperMessage'
- assistant: '#/components/schemas/ChatAssistantMessage'
- tool: '#/components/schemas/ChatToolMessage'
- description: Chat completion message with role-based discrimination
- example:
- role: user
- content: What is the capital of France?
- ModelName:
- type: string
- description: Model to use for completion
- example: openai/gpt-4
- ChatModelNames:
- type: array
- items:
- allOf:
- - $ref: '#/components/schemas/ModelName'
- - description: Available OpenRouter chat completion models
- description: Models to use for completion
- example:
- - openai/gpt-4
- - openai/gpt-4o
- ChatReasoningSummaryVerbosityEnum:
- type: string
- nullable: true
- enum:
- - auto
- - concise
- - detailed
- - null
- example: concise
- ChatFormatTextConfig:
+ - type
+ - item_id
+ - output_index
+ - sequence_number
type: object
+ OpenAIResponsesWebSearchCallSearching:
+ example:
+ item_id: ws_abc123
+ output_index: 0
+ sequence_number: 2
+ type: response.web_search_call.searching
properties:
- type:
+ item_id:
type: string
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
+ type:
enum:
- - text
+ - response.web_search_call.searching
+ type: string
required:
- type
- description: Default text response format
- example:
- type: text
- ChatJsonSchemaConfig:
+ - item_id
+ - output_index
+ - sequence_number
type: object
- properties:
- name:
- type: string
- maxLength: 64
- description: Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
- example: math_response
- description:
- type: string
- description: Schema description for the model
- example: A mathematical response
- schema:
+ OpenResponsesCreatedEvent:
+ allOf:
+ - $ref: '#/components/schemas/CreatedEvent'
+ - properties:
+ response:
+ $ref: '#/components/schemas/OpenResponsesResult'
type: object
- additionalProperties:
- nullable: true
- description: JSON Schema object
- example:
- type: object
- properties:
- answer:
- type: number
- required:
- - answer
- strict:
- type: boolean
- nullable: true
- description: Enable strict schema adherence
- example: false
- required:
- - name
- description: JSON Schema configuration object
+ description: Event emitted when a response is created
example:
- name: math_response
- description: A mathematical response
- schema:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: in_progress
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 0
+ type: response.created
+ OpenResponsesInProgressEvent:
+ allOf:
+ - $ref: '#/components/schemas/InProgressEvent'
+ - properties:
+ response:
+ $ref: '#/components/schemas/OpenResponsesResult'
type: object
- properties:
- answer:
- type: number
- required:
- - answer
- strict: true
- ChatFormatJsonSchemaConfig:
- type: object
+ description: Event emitted when a response is in progress
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: in_progress
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 1
+ type: response.in_progress
+ OpenResponsesLogProbs:
+ description: Log probability information for a token
+ example:
+ logprob: -0.1
+ token: world
+ top_logprobs:
+ - logprob: -0.5
+ token: hello
properties:
- type:
+ bytes:
+ items:
+ type: integer
+ type: array
+ logprob:
+ format: double
+ type: number
+ token:
type: string
- enum:
- - json_schema
- json_schema:
- $ref: '#/components/schemas/ChatJsonSchemaConfig'
+ top_logprobs:
+ items:
+ $ref: '#/components/schemas/OpenResponsesTopLogprobs'
+ type: array
required:
- - type
- - json_schema
- description: JSON Schema response format for structured outputs
+ - logprob
+ - token
+ type: object
+ OpenResponsesResult:
+ allOf:
+ - $ref: '#/components/schemas/BaseResponsesResult'
+ - properties:
+ output:
+ items:
+ $ref: '#/components/schemas/OutputItems'
+ type: array
+ service_tier:
+ nullable: true
+ type: string
+ usage:
+ $ref: '#/components/schemas/Usage'
+ type: object
+ description: Complete non-streaming response from the Responses API
example:
- type: json_schema
- json_schema:
- name: math_response
- schema:
- type: object
- properties:
- answer:
- type: number
- required:
- - answer
- ChatFormatGrammarConfig:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output:
+ - content:
+ - annotations: []
+ text: Hello! How can I help you today?
+ type: output_text
+ id: msg-abc123
+ role: assistant
+ status: completed
+ type: message
+ parallel_tool_calls: true
+ status: completed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ usage:
+ input_tokens: 10
+ input_tokens_details:
+ cached_tokens: 0
+ output_tokens: 25
+ output_tokens_details:
+ reasoning_tokens: 0
+ total_tokens: 35
+ OpenResponsesTopLogprobs:
+ description: Alternative token with its log probability
+ example:
+ logprob: -0.5
+ token: hello
+ properties:
+ bytes:
+ items:
+ type: integer
+ type: array
+ logprob:
+ format: double
+ type: number
+ token:
+ type: string
type: object
+ OpenRouterWebSearchServerTool:
+ description: 'OpenRouter built-in server tool: searches the web for current information'
+ example:
+ parameters:
+ max_results: 5
+ type: openrouter:web_search
properties:
+ parameters:
+ $ref: '#/components/schemas/WebSearchConfig'
type:
- type: string
enum:
- - grammar
- grammar:
+ - openrouter:web_search
type: string
- description: Custom grammar for text generation
- example: root ::= "yes" | "no"
required:
- type
- - grammar
- description: Custom grammar response format
- example:
- type: grammar
- grammar: root ::= "yes" | "no"
- ChatFormatPythonConfig:
type: object
+ ORAnthropicContentBlock:
+ discriminator:
+ mapping:
+ bash_code_execution_tool_result: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
+ code_execution_tool_result: '#/components/schemas/AnthropicCodeExecutionToolResult'
+ compaction: '#/components/schemas/AnthropicCompactionBlock'
+ container_upload: '#/components/schemas/AnthropicContainerUpload'
+ redacted_thinking: '#/components/schemas/AnthropicRedactedThinkingBlock'
+ server_tool_use: '#/components/schemas/AnthropicServerToolUseBlock'
+ text: '#/components/schemas/AnthropicTextBlock'
+ text_editor_code_execution_tool_result: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
+ thinking: '#/components/schemas/AnthropicThinkingBlock'
+ tool_search_tool_result: '#/components/schemas/AnthropicToolSearchToolResult'
+ tool_use: '#/components/schemas/AnthropicToolUseBlock'
+ web_fetch_tool_result: '#/components/schemas/AnthropicWebFetchToolResult'
+ web_search_tool_result: '#/components/schemas/AnthropicWebSearchToolResult'
+ propertyName: type
+ example:
+ citations: null
+ text: Hello, world!
+ type: text
+ oneOf:
+ - $ref: '#/components/schemas/AnthropicTextBlock'
+ - $ref: '#/components/schemas/AnthropicToolUseBlock'
+ - $ref: '#/components/schemas/AnthropicThinkingBlock'
+ - $ref: '#/components/schemas/AnthropicRedactedThinkingBlock'
+ - $ref: '#/components/schemas/AnthropicServerToolUseBlock'
+ - $ref: '#/components/schemas/AnthropicWebSearchToolResult'
+ - $ref: '#/components/schemas/AnthropicWebFetchToolResult'
+ - $ref: '#/components/schemas/AnthropicCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicBashCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicTextEditorCodeExecutionToolResult'
+ - $ref: '#/components/schemas/AnthropicToolSearchToolResult'
+ - $ref: '#/components/schemas/AnthropicContainerUpload'
+ - $ref: '#/components/schemas/AnthropicCompactionBlock'
+ ORAnthropicStopReason:
+ enum:
+ - end_turn
+ - max_tokens
+ - stop_sequence
+ - tool_use
+ - pause_turn
+ - refusal
+ - compaction
+ - null
+ example: end_turn
+ nullable: true
+ type: string
+ OutputDatetimeItem:
+ description: An openrouter:datetime server tool output item
+ example:
+ datetime: '2026-03-12T14:30:00.000Z'
+ id: dt_tmp_abc123
+ status: completed
+ timezone: UTC
+ type: openrouter:datetime
properties:
- type:
+ datetime:
+ description: ISO 8601 datetime string
+ type: string
+ id:
+ type: string
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ timezone:
+ description: IANA timezone name
type: string
+ type:
enum:
- - python
+ - openrouter:datetime
+ type: string
required:
+ - status
- type
- description: Python code response format
- example:
- type: python
- ChatStreamOptions:
+ - datetime
+ - timezone
type: object
- nullable: true
- properties:
- include_usage:
- type: boolean
- description: 'Deprecated: This field has no effect. Full usage details are always included.'
- example: true
- deprecated: true
- description: Streaming configuration options
+ OutputFileSearchCallItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemFileSearchCall'
+ - properties: {}
+ type: object
example:
- include_usage: true
- ChatNamedToolChoice:
- type: object
+ id: fs-abc123
+ queries:
+ - search term
+ results: []
+ status: completed
+ type: file_search_call
+ OutputFunctionCallItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemFunctionCall'
+ - properties: {}
+ type: object
+ example:
+ arguments: '{"location":"San Francisco"}'
+ call_id: call-abc123
+ id: fc-abc123
+ name: get_weather
+ status: completed
+ type: function_call
+ OutputImageGenerationCallItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemImageGenerationCall'
+ - properties: {}
+ type: object
+ example:
+ id: img-abc123
+ result: null
+ status: completed
+ type: image_generation_call
+ OutputItemAddedEvent:
+ description: Event emitted when a new output item is added to the response
+ example:
+ item:
+ content: []
+ id: item-1
+ role: assistant
+ status: in_progress
+ type: message
+ output_index: 0
+ sequence_number: 2
+ type: response.output_item.added
properties:
+ item:
+ discriminator:
+ mapping:
+ file_search_call: '#/components/schemas/OutputItemFileSearchCall'
+ function_call: '#/components/schemas/OutputItemFunctionCall'
+ image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
+ message: '#/components/schemas/OutputMessage'
+ reasoning: '#/components/schemas/OutputItemReasoning'
+ web_search_call: '#/components/schemas/OutputItemWebSearchCall'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/OutputMessage'
+ - $ref: '#/components/schemas/OutputItemReasoning'
+ - $ref: '#/components/schemas/OutputItemFunctionCall'
+ - $ref: '#/components/schemas/OutputItemWebSearchCall'
+ - $ref: '#/components/schemas/OutputItemFileSearchCall'
+ - $ref: '#/components/schemas/OutputItemImageGenerationCall'
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
type:
- type: string
enum:
- - function
- function:
- type: object
- properties:
- name:
- type: string
- description: Function name to call
- example: get_weather
- required:
- - name
+ - response.output_item.added
+ type: string
required:
- type
- - function
- description: Named tool choice for specific function
+ - output_index
+ - item
+ - sequence_number
+ type: object
+ OutputItemDoneEvent:
+ description: Event emitted when an output item is complete
example:
- type: function
- function:
- name: get_weather
- ChatToolChoice:
- anyOf:
- - type: string
- enum:
- - none
- - type: string
- enum:
- - auto
- - type: string
+ item:
+ content:
+ - annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ id: item-1
+ role: assistant
+ status: completed
+ type: message
+ output_index: 0
+ sequence_number: 8
+ type: response.output_item.done
+ properties:
+ item:
+ discriminator:
+ mapping:
+ file_search_call: '#/components/schemas/OutputItemFileSearchCall'
+ function_call: '#/components/schemas/OutputItemFunctionCall'
+ image_generation_call: '#/components/schemas/OutputItemImageGenerationCall'
+ message: '#/components/schemas/OutputMessage'
+ reasoning: '#/components/schemas/OutputItemReasoning'
+ web_search_call: '#/components/schemas/OutputItemWebSearchCall'
+ propertyName: type
+ oneOf:
+ - $ref: '#/components/schemas/OutputMessage'
+ - $ref: '#/components/schemas/OutputItemReasoning'
+ - $ref: '#/components/schemas/OutputItemFunctionCall'
+ - $ref: '#/components/schemas/OutputItemWebSearchCall'
+ - $ref: '#/components/schemas/OutputItemFileSearchCall'
+ - $ref: '#/components/schemas/OutputItemImageGenerationCall'
+ output_index:
+ type: integer
+ sequence_number:
+ type: integer
+ type:
enum:
- - required
- - $ref: '#/components/schemas/ChatNamedToolChoice'
- description: Tool choice configuration
- example: auto
- ChatWebSearchShorthand:
+ - response.output_item.done
+ type: string
+ required:
+ - type
+ - output_index
+ - item
+ - sequence_number
type: object
+ OutputItemFileSearchCall:
+ example:
+ id: filesearch-abc123
+ queries:
+ - machine learning algorithms
+ - neural networks
+ status: completed
+ type: file_search_call
properties:
- type:
+ id:
type: string
- enum:
- - web_search
- - web_search_preview
- - web_search_preview_2025_03_11
- - web_search_2025_08_26
- engine:
- $ref: '#/components/schemas/WebSearchEngineEnum'
- max_results:
- type: integer
- description: >-
- Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
- Parallel engines; ignored with native provider search.
- example: 5
- max_total_results:
- type: integer
- description: >-
- Maximum total number of search results across all search calls in a single request. Once this limit is
- reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
- loops.
- example: 20
- search_context_size:
- $ref: '#/components/schemas/SearchQualityLevel'
- user_location:
- $ref: '#/components/schemas/WebSearchUserLocationServerTool'
- allowed_domains:
- type: array
+ queries:
items:
type: string
- description: >-
- Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic,
- OpenAI, xAI). Not supported with Firecrawl or Perplexity.
- excluded_domains:
type: array
- items:
- type: string
- description: >-
- Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported
- with Firecrawl, OpenAI (silently ignored), or Perplexity.
- parameters:
- $ref: '#/components/schemas/WebSearchConfig'
+ status:
+ $ref: '#/components/schemas/WebSearchStatus'
+ type:
+ enum:
+ - file_search_call
+ type: string
required:
- type
- description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
+ - id
+ - queries
+ - status
+ type: object
+ OutputItemFunctionCall:
example:
- type: web_search_preview
- ChatFunctionTool:
- anyOf:
- - type: object
- properties:
- type:
+ arguments: '{"location":"San Francisco","unit":"celsius"}'
+ call_id: call-abc123
+ id: call-abc123
+ name: get_weather
+ type: function_call
+ properties:
+ arguments:
+ type: string
+ call_id:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ status:
+ anyOf:
+ - enum:
+ - completed
type: string
- enum:
- - function
- function:
- type: object
- properties:
- name:
- type: string
- maxLength: 64
- description: Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)
- example: get_weather
- description:
- type: string
- description: Function description for the model
- example: Get the current weather for a location
- parameters:
- type: object
- additionalProperties:
- nullable: true
- description: Function parameters as JSON Schema object
- example:
- type: object
- properties:
- location:
- type: string
- description: City name
- required:
- - location
- strict:
- type: boolean
- nullable: true
- description: Enable strict schema adherence
- example: false
- required:
- - name
- description: Function definition for tool calling
- example:
- name: get_weather
- description: Get the current weather for a location
- parameters:
- type: object
- properties:
- location:
- type: string
- description: City name
- required:
- - location
- cache_control:
- $ref: '#/components/schemas/ChatContentCacheControl'
- required:
- - type
- - function
- - $ref: '#/components/schemas/DatetimeServerTool'
- - $ref: '#/components/schemas/OpenRouterWebSearchServerTool'
- - $ref: '#/components/schemas/ChatWebSearchShorthand'
- description: Tool definition for function calling (regular function or OpenRouter built-in server tool)
- example:
- type: function
- function:
- name: get_weather
- description: Get the current weather for a location
- parameters:
- type: object
- properties:
- location:
- type: string
- description: City name
- unit:
- type: string
- enum:
- - celsius
- - fahrenheit
- required:
- - location
- ChatDebugOptions:
+ - enum:
+ - incomplete
+ type: string
+ - enum:
+ - in_progress
+ type: string
+ type:
+ enum:
+ - function_call
+ type: string
+ required:
+ - type
+ - name
+ - arguments
+ - call_id
type: object
- properties:
- echo_upstream_body:
- type: boolean
- description: >-
- If true, includes the transformed upstream request body in a debug chunk at the start of the stream. Only
- works with streaming mode.
- example: true
- description: Debug options for inspecting request transformations (streaming only)
+ OutputItemImageGenerationCall:
example:
- echo_upstream_body: true
- ChatRequest:
- type: object
+ id: imagegen-abc123
+ result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
+ status: completed
+ type: image_generation_call
properties:
- provider:
- $ref: '#/components/schemas/ProviderPreferences'
- plugins:
- type: array
- items:
- oneOf:
- - $ref: '#/components/schemas/AutoRouterPlugin'
- - $ref: '#/components/schemas/ModerationPlugin'
- - $ref: '#/components/schemas/WebSearchPlugin'
- - $ref: '#/components/schemas/FileParserPlugin'
- - $ref: '#/components/schemas/ResponseHealingPlugin'
- - $ref: '#/components/schemas/ContextCompressionPlugin'
- discriminator:
- propertyName: id
- mapping:
- auto-router: '#/components/schemas/AutoRouterPlugin'
- moderation: '#/components/schemas/ModerationPlugin'
- web: '#/components/schemas/WebSearchPlugin'
- file-parser: '#/components/schemas/FileParserPlugin'
- response-healing: '#/components/schemas/ResponseHealingPlugin'
- context-compression: '#/components/schemas/ContextCompressionPlugin'
- description: Plugins you want to enable for this request, including their settings.
- route:
- $ref: '#/components/schemas/DeprecatedRoute'
- user:
+ id:
type: string
- description: Unique user identifier
- example: user-123
- session_id:
+ result:
+ default: null
+ nullable: true
type: string
- maxLength: 256
- description: >-
- A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
- observability. If provided in both the request body and the x-session-id header, the body value takes
- precedence. Maximum of 256 characters.
- trace:
- $ref: '#/components/schemas/TraceConfig'
- messages:
- type: array
+ status:
+ $ref: '#/components/schemas/ImageGenerationStatus'
+ type:
+ enum:
+ - image_generation_call
+ type: string
+ required:
+ - type
+ - id
+ - status
+ type: object
+ OutputItemReasoning:
+ example:
+ id: reasoning-abc123
+ summary:
+ - text: Analyzed the problem using first principles
+ type: summary_text
+ type: reasoning
+ properties:
+ content:
items:
- $ref: '#/components/schemas/ChatMessages'
- minItems: 1
- description: List of messages for the conversation
- example:
- - role: user
- content: Hello!
- model:
- $ref: '#/components/schemas/ModelName'
- models:
- $ref: '#/components/schemas/ChatModelNames'
- frequency_penalty:
- type: number
- format: double
- description: Frequency penalty (-2.0 to 2.0)
- example: 0
- logit_bias:
- type: object
- nullable: true
- additionalProperties:
- type: number
- format: double
- description: Token logit bias adjustments
- example:
- '50256': -100
- logprobs:
- type: boolean
+ $ref: '#/components/schemas/ReasoningTextContent'
+ type: array
+ encrypted_content:
nullable: true
- description: Return log probabilities
- example: false
- top_logprobs:
- type: integer
- description: Number of top log probabilities to return (0-20)
- example: 5
- max_completion_tokens:
- type: integer
- description: Maximum tokens in completion
- example: 100
- max_tokens:
- type: integer
- description: 'Maximum tokens (deprecated, use max_completion_tokens). Note: some providers enforce a minimum of 16.'
- example: 100
- metadata:
- type: object
- additionalProperties:
- type: string
- description: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values)
- example:
- user_id: user-123
- session_id: session-456
- presence_penalty:
- type: number
- format: double
- description: Presence penalty (-2.0 to 2.0)
- example: 0
- reasoning:
- type: object
- properties:
- effort:
- type: string
- nullable: true
- enum:
- - xhigh
- - high
- - medium
- - low
- - minimal
- - none
- - null
- description: Constrains effort on reasoning for reasoning models
- example: medium
- summary:
- $ref: '#/components/schemas/ChatReasoningSummaryVerbosityEnum'
- description: Configuration options for reasoning models
- example:
- effort: medium
- summary: concise
- response_format:
- oneOf:
- - $ref: '#/components/schemas/ChatFormatTextConfig'
- - $ref: '#/components/schemas/FormatJsonObjectConfig'
- - $ref: '#/components/schemas/ChatFormatJsonSchemaConfig'
- - $ref: '#/components/schemas/ChatFormatGrammarConfig'
- - $ref: '#/components/schemas/ChatFormatPythonConfig'
- discriminator:
- propertyName: type
- mapping:
- text: '#/components/schemas/ChatFormatTextConfig'
- json_object: '#/components/schemas/FormatJsonObjectConfig'
- json_schema: '#/components/schemas/ChatFormatJsonSchemaConfig'
- grammar: '#/components/schemas/ChatFormatGrammarConfig'
- python: '#/components/schemas/ChatFormatPythonConfig'
- description: Response format configuration
- example:
- type: json_object
- seed:
- type: integer
- description: Random seed for deterministic outputs
- example: 42
- stop:
+ type: string
+ id:
+ type: string
+ status:
anyOf:
- - type: string
- - type: array
- items:
- type: string
- maxItems: 4
- - nullable: true
- description: Stop sequences (up to 4)
- example:
- - |+
-
- stream:
- type: boolean
- default: false
- description: Enable streaming response
- example: false
- stream_options:
- $ref: '#/components/schemas/ChatStreamOptions'
- temperature:
- type: number
- format: double
- description: Sampling temperature (0-2)
- example: 0.7
- parallel_tool_calls:
- type: boolean
- nullable: true
- description: >-
- Whether to enable parallel function calling during tool use. When true, the model may generate multiple tool
- calls in a single response.
- example: true
- tool_choice:
- $ref: '#/components/schemas/ChatToolChoice'
- tools:
- type: array
+ - enum:
+ - completed
+ type: string
+ - enum:
+ - incomplete
+ type: string
+ - enum:
+ - in_progress
+ type: string
+ summary:
items:
- $ref: '#/components/schemas/ChatFunctionTool'
- description: Available tools for function calling
- example:
- - type: function
- function:
- name: get_weather
- description: Get weather
- top_p:
- type: number
- format: double
- description: Nucleus sampling parameter (0-1)
- example: 1
- debug:
- $ref: '#/components/schemas/ChatDebugOptions'
- image_config:
- type: object
- additionalProperties:
- anyOf:
- - type: string
- - type: number
- format: double
- - type: array
- items:
- nullable: true
- description: >-
- Provider-specific image configuration options. Keys and values vary by model/provider. See
- https://openrouter.ai/docs/guides/overview/multimodal/image-generation for more details.
- example:
- aspect_ratio: '16:9'
- modalities:
+ $ref: '#/components/schemas/ReasoningSummaryText'
type: array
- items:
- type: string
- enum:
- - text
- - image
- - audio
- description: Output modalities for the response. Supported values are "text", "image", and "audio".
- example:
- - text
- - image
- cache_control:
- allOf:
- - $ref: '#/components/schemas/AnthropicCacheControlDirective'
- - description: >-
- Enable automatic prompt caching. When set, the system automatically applies cache breakpoints to the
- last cacheable block in the request. Currently supported for Anthropic Claude models.
- service_tier:
- type: string
- nullable: true
+ type:
enum:
- - auto
- - default
- - flex
- - priority
- - scale
- - null
- description: The service tier to use for processing this request.
- example: auto
- required:
- - messages
- description: Chat completion request parameters
- example:
- messages:
- - role: system
- content: You are a helpful assistant.
- - role: user
- content: What is the capital of France?
- model: openai/gpt-4
- temperature: 0.7
- max_tokens: 150
- GoneResponseErrorData:
- type: object
- properties:
- code:
- type: integer
- message:
+ - reasoning
type: string
- metadata:
- type: object
- nullable: true
- additionalProperties:
- nullable: true
required:
- - code
- - message
- description: Error data for GoneResponse
- example:
- code: 410
- message: >-
- The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been
- removed. Use the web credits purchase flow instead.
- GoneResponse:
+ - type
+ - id
+ - summary
type: object
+ OutputItems:
+ description: An output item from the response
+ discriminator:
+ mapping:
+ file_search_call: '#/components/schemas/OutputFileSearchCallItem'
+ function_call: '#/components/schemas/OutputFunctionCallItem'
+ image_generation_call: '#/components/schemas/OutputImageGenerationCallItem'
+ message: '#/components/schemas/OutputMessageItem'
+ openrouter:datetime: '#/components/schemas/OutputDatetimeItem'
+ openrouter:web_search: '#/components/schemas/OutputWebSearchServerToolItem'
+ reasoning: '#/components/schemas/OutputReasoningItem'
+ web_search_call: '#/components/schemas/OutputWebSearchCallItem'
+ propertyName: type
+ example:
+ content:
+ - text: Hello! How can I help you today?
+ type: output_text
+ id: msg-abc123
+ role: assistant
+ status: completed
+ type: message
+ oneOf:
+ - $ref: '#/components/schemas/OutputMessageItem'
+ - $ref: '#/components/schemas/OutputReasoningItem'
+ - $ref: '#/components/schemas/OutputFunctionCallItem'
+ - $ref: '#/components/schemas/OutputWebSearchCallItem'
+ - $ref: '#/components/schemas/OutputFileSearchCallItem'
+ - $ref: '#/components/schemas/OutputImageGenerationCallItem'
+ - $ref: '#/components/schemas/OutputDatetimeItem'
+ - $ref: '#/components/schemas/OutputWebSearchServerToolItem'
+ OutputItemWebSearchCall:
+ example:
+ action:
+ query: OpenAI API
+ type: search
+ id: search-abc123
+ status: completed
+ type: web_search_call
properties:
- error:
- $ref: '#/components/schemas/GoneResponseErrorData'
- user_id:
+ action:
+ oneOf:
+ - properties:
+ queries:
+ items:
+ type: string
+ type: array
+ query:
+ type: string
+ sources:
+ items:
+ $ref: '#/components/schemas/WebSearchSource'
+ type: array
+ type:
+ enum:
+ - search
+ type: string
+ required:
+ - type
+ - query
+ type: object
+ - properties:
+ type:
+ enum:
+ - open_page
+ type: string
+ url:
+ nullable: true
+ type: string
+ required:
+ - type
+ type: object
+ - properties:
+ pattern:
+ type: string
+ type:
+ enum:
+ - find_in_page
+ type: string
+ url:
+ type: string
+ required:
+ - type
+ - pattern
+ - url
+ type: object
+ id:
+ type: string
+ status:
+ $ref: '#/components/schemas/WebSearchStatus'
+ type:
+ enum:
+ - web_search_call
type: string
- nullable: true
required:
- - error
- description: Gone - Endpoint has been permanently removed or deprecated
- example:
- error:
- code: 410
- message: >-
- The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API has been
- removed. Use the web credits purchase flow instead.
- ProviderResponse:
+ - type
+ - id
+ - action
+ - status
type: object
+ OutputMessage:
+ example:
+ content:
+ - text: Hello! How can I help you today?
+ type: output_text
+ id: msg-abc123
+ role: assistant
+ status: completed
+ type: message
properties:
+ content:
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ResponseOutputText'
+ - $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
+ type: array
id:
type: string
- description: Upstream provider response identifier
- example: chatcmpl-abc123
- endpoint_id:
- type: string
- description: Internal endpoint identifier
- example: ep_abc123
- model_permaslug:
- type: string
- description: Canonical model slug
- example: openai/gpt-4
- provider_name:
- type: string
+ phase:
+ anyOf:
+ - enum:
+ - commentary
+ type: string
+ - enum:
+ - final_answer
+ type: string
+ - nullable: true
+ description: >-
+ The phase of an assistant message. Use `commentary` for an intermediate assistant message and `final_answer`
+ for the final assistant message. For follow-up requests with models like `gpt-5.3-codex` and later, preserve
+ and resend phase on all assistant messages. Omitting it can degrade performance. Not used for user messages.
+ role:
enum:
- - AnyScale
- - Atoma
- - Cent-ML
- - CrofAI
- - Enfer
- - GoPomelo
- - HuggingFace
- - Hyperbolic 2
- - InoCloud
- - Kluster
- - Lambda
- - Lepton
- - Lynn 2
- - Lynn
- - Mancer
- - Meta
- - Modal
- - Nineteen
- - OctoAI
- - Recursal
- - Reflection
- - Replicate
- - SambaNova 2
- - SF Compute
- - Targon
- - Together 2
- - Ubicloud
- - 01.AI
- - AkashML
- - AI21
- - AionLabs
- - Alibaba
- - Ambient
- - Amazon Bedrock
- - Amazon Nova
- - Anthropic
- - Arcee AI
- - AtlasCloud
- - Avian
- - Azure
- - BaseTen
- - BytePlus
- - Black Forest Labs
- - Cerebras
- - Chutes
- - Cirrascale
- - Clarifai
- - Cloudflare
- - Cohere
- - Crusoe
- - DeepInfra
- - DeepSeek
- - Featherless
- - Fireworks
- - Friendli
- - GMICloud
- - Google
- - Google AI Studio
- - Groq
- - Hyperbolic
- - Inception
- - Inceptron
- - InferenceNet
- - Ionstream
- - Infermatic
- - Io Net
- - Inflection
- - Liquid
- - Mara
- - Mancer 2
- - Minimax
- - ModelRun
- - Mistral
- - Modular
- - Moonshot AI
- - Morph
- - NCompass
- - Nebius
- - NextBit
- - Novita
- - Nvidia
- - OpenAI
- - OpenInference
- - Parasail
- - Perplexity
- - Phala
- - Reka
- - Relace
- - SambaNova
- - Seed
- - SiliconFlow
- - Sourceful
- - StepFun
- - Stealth
- - StreamLake
- - Switchpoint
- - Together
- - Upstage
- - Venice
- - WandB
- - Xiaomi
- - xAI
- - Z.AI
- - FakeProvider
- description: Name of the provider
- example: OpenAI
+ - assistant
+ type: string
status:
- type: number
- nullable: true
- description: HTTP status code from the provider
- example: 200
- latency:
- type: number
- description: Response latency in milliseconds
- example: 1200
- is_byok:
- type: boolean
- description: Whether the request used a bring-your-own-key
- example: false
+ anyOf:
+ - enum:
+ - completed
+ type: string
+ - enum:
+ - incomplete
+ type: string
+ - enum:
+ - in_progress
+ type: string
+ type:
+ enum:
+ - message
+ type: string
required:
- - status
- description: Details of a provider response for a generation attempt
- example:
- id: chatcmpl-abc123
- endpoint_id: ep_abc123
- model_permaslug: openai/gpt-4
- provider_name: OpenAI
- status: 200
- latency: 1200
- is_byok: false
- ModelsCountResponse:
+ - id
+ - role
+ - type
+ - content
type: object
- properties:
- data:
+ OutputMessageItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputMessage'
+ - properties: {}
type: object
- properties:
- count:
- type: integer
- description: Total number of available models
- example: 150
- required:
- - count
- description: Model count data
- example:
- count: 150
- required:
- - data
- description: Model count data
- example:
- data:
- count: 150
- PublicPricing:
- type: object
- properties:
- prompt:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- completion:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- request:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image_token:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image_output:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- audio:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- audio_output:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_audio_cache:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- web_search:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- internal_reasoning:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_cache_read:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_cache_write:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- discount:
- type: number
- required:
- - prompt
- - completion
- description: Pricing information for the model
+ description: An output message item
example:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- ModelGroup:
- type: string
- enum:
- - Router
- - Media
- - Other
- - GPT
- - Claude
- - Gemini
- - Gemma
- - Grok
- - Cohere
- - Nova
- - Qwen
- - Yi
- - DeepSeek
- - Mistral
- - Llama2
- - Llama3
- - Llama4
- - PaLM
- - RWKV
- - Qwen3
- example: GPT
- description: Tokenizer type used by the model
- InputModality:
+ content:
+ - annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ id: msg-123
+ role: assistant
+ status: completed
+ type: message
+ OutputModality:
+ enum:
+ - text
+ - image
+ - embeddings
+ - audio
+ - video
+ - rerank
+ example: text
type: string
+ OutputModalityEnum:
enum:
- text
- image
- - file
- - audio
- - video
example: text
- OutputModality:
type: string
- enum:
- - text
- - image
- - embeddings
- - audio
- - video
- - rerank
- example: text
- ModelArchitecture:
- type: object
+ OutputReasoningItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemReasoning'
+ - properties:
+ content:
+ items:
+ $ref: '#/components/schemas/ReasoningTextContent'
+ nullable: true
+ type: array
+ format:
+ $ref: '#/components/schemas/ReasoningFormat'
+ signature:
+ description: A signature for the reasoning content, used for verification
+ example: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
+ nullable: true
+ type: string
+ type: object
+ description: An output item containing reasoning
+ example:
+ content:
+ - text: First, we analyze the problem...
+ type: reasoning_text
+ format: anthropic-claude-v1
+ id: reasoning-123
+ signature: EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...
+ status: completed
+ summary:
+ - text: Analyzed the problem and found the optimal solution.
+ type: summary_text
+ type: reasoning
+ OutputWebSearchCallItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemWebSearchCall'
+ - properties: {}
+ type: object
+ example:
+ id: ws-abc123
+ status: completed
+ type: web_search_call
+ OutputWebSearchServerToolItem:
+ description: An openrouter:web_search server tool output item
+ example:
+ id: ws_tmp_abc123
+ status: completed
+ type: openrouter:web_search
properties:
- tokenizer:
- $ref: '#/components/schemas/ModelGroup'
- instruct_type:
+ id:
type: string
- nullable: true
+ status:
+ $ref: '#/components/schemas/ToolCallStatus'
+ type:
enum:
- - none
- - airoboros
- - alpaca
- - alpaca-modif
- - chatml
- - claude
- - code-llama
- - gemma
- - llama2
- - llama3
- - mistral
- - nemotron
- - neural
- - openchat
- - phi3
- - rwkv
- - vicuna
- - zephyr
- - deepseek-r1
- - deepseek-v3.1
- - qwq
- - qwen3
- - null
- example: chatml
- description: Instruction format type
- modality:
+ - openrouter:web_search
type: string
- nullable: true
- description: Primary modality of the model
- example: text->text
- input_modalities:
- type: array
- items:
- $ref: '#/components/schemas/InputModality'
- description: Supported input modalities
- output_modalities:
- type: array
- items:
- $ref: '#/components/schemas/OutputModality'
- description: Supported output modalities
- required:
- - modality
- - input_modalities
- - output_modalities
- description: Model architecture information
- example:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- TopProviderInfo:
- type: object
- properties:
- context_length:
- type: integer
- description: Context length from the top provider
- example: 8192
- max_completion_tokens:
- type: integer
- description: Maximum completion tokens from the top provider
- example: 4096
- is_moderated:
- type: boolean
- description: Whether the top provider moderates content
- example: true
required:
- - is_moderated
- description: Information about the top provider for this model
- example:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- PerRequestLimits:
+ - status
+ - type
type: object
- nullable: true
- properties:
- prompt_tokens:
- type: number
- example: 1000
- description: Maximum prompt tokens per request
- completion_tokens:
- type: number
- example: 1000
- description: Maximum completion tokens per request
- required:
- - prompt_tokens
- - completion_tokens
- description: Per-request token limits
- example:
- prompt_tokens: 1000
- completion_tokens: 1000
Parameter:
- type: string
enum:
- temperature
- top_p
@@ -10682,7060 +9213,8529 @@ components:
- web_search_options
- verbosity
example: temperature
- DefaultParameters:
- type: object
- nullable: true
+ type: string
+ PayloadTooLargeResponse:
+ description: Payload Too Large - Request payload exceeds size limits
+ example:
+ error:
+ code: 413
+ message: Request payload too large
properties:
- temperature:
- type: number
- format: double
- top_p:
- type: number
- format: double
- top_k:
- type: integer
+ error:
+ $ref: '#/components/schemas/PayloadTooLargeResponseErrorData'
+ user_id:
nullable: true
- minimum: 0
- frequency_penalty:
- type: number
- format: double
- presence_penalty:
- type: number
- format: double
- repetition_penalty:
- type: number
- format: double
- additionalProperties: false
- description: Default parameters for this model
- example:
- temperature: 0.7
- top_p: 0.9
- top_k: 0
- frequency_penalty: 0
- presence_penalty: 0
- repetition_penalty: 1
- ModelLinks:
+ type: string
+ required:
+ - error
type: object
+ PayloadTooLargeResponseErrorData:
+ description: Error data for PayloadTooLargeResponse
+ example:
+ code: 413
+ message: Request payload too large
properties:
- details:
+ code:
+ type: integer
+ message:
type: string
- description: URL for the model details/endpoints API
- example: /api/v1/models/openai/gpt-5.4/endpoints
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
required:
- - details
- description: Related API endpoints and resources for this model.
- example:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- Model:
+ - code
+ - message
type: object
+ PaymentRequiredResponse:
+ description: Payment Required - Insufficient credits or quota to complete request
+ example:
+ error:
+ code: 402
+ message: Insufficient credits. Add more using https://openrouter.ai/credits
properties:
- id:
- type: string
- description: Unique identifier for the model
- example: openai/gpt-4
- canonical_slug:
+ error:
+ $ref: '#/components/schemas/PaymentRequiredResponseErrorData'
+ user_id:
+ nullable: true
type: string
- description: Canonical slug for the model
- example: openai/gpt-4
- hugging_face_id:
- type: string
- nullable: true
- description: Hugging Face model identifier, if applicable
- example: microsoft/DialoGPT-medium
- name:
- type: string
- description: Display name of the model
- example: GPT-4
- created:
- type: integer
- description: Unix timestamp of when the model was created
- example: 1692901234
- description:
- type: string
- description: Description of the model
- example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- $ref: '#/components/schemas/PublicPricing'
- context_length:
+ required:
+ - error
+ type: object
+ PaymentRequiredResponseErrorData:
+ description: Error data for PaymentRequiredResponse
+ example:
+ code: 402
+ message: Insufficient credits. Add more using https://openrouter.ai/credits
+ properties:
+ code:
type: integer
- description: Maximum context length in tokens
- example: 8192
- architecture:
- $ref: '#/components/schemas/ModelArchitecture'
- top_provider:
- $ref: '#/components/schemas/TopProviderInfo'
- per_request_limits:
- $ref: '#/components/schemas/PerRequestLimits'
- supported_parameters:
- type: array
- items:
- $ref: '#/components/schemas/Parameter'
- description: List of supported parameters for this model
- default_parameters:
- $ref: '#/components/schemas/DefaultParameters'
- knowledge_cutoff:
- type: string
- nullable: true
- description: The date up to which the model was trained on data. ISO 8601 date string (YYYY-MM-DD) or null if unknown.
- example: '2024-10-01'
- expiration_date:
+ message:
type: string
+ metadata:
+ additionalProperties:
+ nullable: true
nullable: true
- description: The date after which the model may be removed. ISO 8601 date string (YYYY-MM-DD) or null if no expiration.
- example: '2025-06-01'
- links:
- $ref: '#/components/schemas/ModelLinks'
+ type: object
required:
- - id
- - canonical_slug
- - name
- - created
- - pricing
- - context_length
- - architecture
- - top_provider
- - per_request_limits
- - supported_parameters
- - default_parameters
- - links
- description: Information about an AI model available on OpenRouter
- example:
- id: openai/gpt-4
- canonical_slug: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- top_provider:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- per_request_limits: null
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- ModelsListResponseData:
- type: array
- items:
- $ref: '#/components/schemas/Model'
- description: List of available models
- example:
- - id: openai/gpt-4
- canonical_slug: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- top_provider:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- per_request_limits: null
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- ModelsListResponse:
+ - code
+ - message
type: object
- properties:
- data:
- $ref: '#/components/schemas/ModelsListResponseData'
- required:
- - data
- description: List of available models
+ PDFParserEngine:
+ anyOf:
+ - enum:
+ - mistral-ocr
+ - native
+ - cloudflare-ai
+ type: string
+ - enum:
+ - pdf-text
+ type: string
+ description: >-
+ The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to
+ "cloudflare-ai".
+ example: cloudflare-ai
+ PDFParserOptions:
+ description: Options for PDF parsing.
example:
- data:
- - id: openai/gpt-4
- canonical_slug: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- top_provider:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- per_request_limits: null
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- - frequency_penalty
- - presence_penalty
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- InstructType:
- type: string
- nullable: true
- enum:
- - none
- - airoboros
- - alpaca
- - alpaca-modif
- - chatml
- - claude
- - code-llama
- - gemma
- - llama2
- - llama3
- - mistral
- - nemotron
- - neural
- - openchat
- - phi3
- - rwkv
- - vicuna
- - zephyr
- - deepseek-r1
- - deepseek-v3.1
- - qwq
- - qwen3
- - null
- example: chatml
- description: Instruction format type
- EndpointStatus:
- type: integer
- enum:
- - 0
- - -1
- - -2
- - -3
- - -5
- - -10
- example: 0
- PercentileStats:
+ engine: cloudflare-ai
+ properties:
+ engine:
+ $ref: '#/components/schemas/PDFParserEngine'
type: object
- nullable: true
+ PercentileLatencyCutoffs:
+ description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
+ example:
+ p50: 5
+ p90: 10
properties:
p50:
- type: number
+ description: Maximum p50 latency (seconds)
format: double
- description: Median (50th percentile)
- example: 25.5
+ type: number
p75:
+ description: Maximum p75 latency (seconds)
+ format: double
+ type: number
+ p90:
+ description: Maximum p90 latency (seconds)
+ format: double
type: number
+ p99:
+ description: Maximum p99 latency (seconds)
+ format: double
+ type: number
+ type: object
+ PercentileStats:
+ description: >-
+ Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible
+ when authenticated with an API key or cookie; returns null for unauthenticated requests.
+ example:
+ p50: 25.5
+ p75: 35.2
+ p90: 48.7
+ p99: 85.3
+ nullable: true
+ properties:
+ p50:
+ description: Median (50th percentile)
+ example: 25.5
format: double
+ type: number
+ p75:
description: 75th percentile
example: 35.2
- p90:
- type: number
format: double
+ type: number
+ p90:
description: 90th percentile
example: 48.7
- p99:
- type: number
format: double
+ type: number
+ p99:
description: 99th percentile
example: 85.3
+ format: double
+ type: number
required:
- p50
- p75
- p90
- p99
- example:
- p50: 25.5
- p75: 35.2
- p90: 48.7
- p99: 85.3
- description: >-
- Latency percentiles in milliseconds over the last 30 minutes. Latency measures time to first token. Only visible
- when authenticated with an API key or cookie; returns null for unauthenticated requests.
- PublicEndpoint:
type: object
+ PercentileThroughputCutoffs:
+ description: Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
+ example:
+ p50: 100
+ p90: 50
properties:
- name:
- type: string
- model_id:
- type: string
- description: The unique identifier for the model (permaslug)
- example: openai/gpt-4
- model_name:
- type: string
- context_length:
- type: integer
- pricing:
- type: object
- properties:
- prompt:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- completion:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- request:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image_token:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- image_output:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- audio:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- audio_output:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_audio_cache:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- web_search:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- internal_reasoning:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_cache_read:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- input_cache_write:
- allOf:
- - $ref: '#/components/schemas/BigNumberUnion'
- - description: A number or string value representing a large number
- discount:
- type: number
- required:
- - prompt
- - completion
- provider_name:
- $ref: '#/components/schemas/ProviderName'
- tag:
- type: string
- quantization:
- allOf:
- - $ref: '#/components/schemas/Quantization'
- - nullable: true
- max_completion_tokens:
- type: integer
- max_prompt_tokens:
- type: integer
- supported_parameters:
- type: array
- items:
- $ref: '#/components/schemas/Parameter'
- status:
- $ref: '#/components/schemas/EndpointStatus'
- uptime_last_30m:
+ p50:
+ description: Minimum p50 throughput (tokens/sec)
+ format: double
type: number
+ p75:
+ description: Minimum p75 throughput (tokens/sec)
format: double
- uptime_last_5m:
type: number
+ p90:
+ description: Minimum p90 throughput (tokens/sec)
format: double
- description: >-
- Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests)
- * 100. Rate-limited requests are excluded. Returns null if insufficient data.
- uptime_last_1d:
type: number
+ p99:
+ description: Minimum p99 throughput (tokens/sec)
format: double
+ type: number
+ type: object
+ PerRequestLimits:
+ description: Per-request token limits
+ example:
+ completion_tokens: 1000
+ prompt_tokens: 1000
+ nullable: true
+ properties:
+ completion_tokens:
+ description: Maximum completion tokens per request
+ example: 1000
+ type: number
+ prompt_tokens:
+ description: Maximum prompt tokens per request
+ example: 1000
+ type: number
+ required:
+ - prompt_tokens
+ - completion_tokens
+ type: object
+ PreferredMaxLatency:
+ anyOf:
+ - format: double
+ type: number
+ - $ref: '#/components/schemas/PercentileLatencyCutoffs'
+ - nullable: true
+ description: >-
+ 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.
+ example: 5
+ PreferredMinThroughput:
+ anyOf:
+ - format: double
+ type: number
+ - $ref: '#/components/schemas/PercentileThroughputCutoffs'
+ - nullable: true
+ description: >-
+ 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.
+ example: 100
+ Preview_20250311_WebSearchServerTool:
+ description: Web search preview tool configuration (2025-03-11 version)
+ example:
+ type: web_search_preview_2025_03_11
+ properties:
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ filters:
+ $ref: '#/components/schemas/WebSearchDomainFilter'
+ max_results:
description: >-
- Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) *
- 100. Rate-limited requests are excluded. Returns null if insufficient data.
- supports_implicit_caching:
- type: boolean
- latency_last_30m:
- $ref: '#/components/schemas/PercentileStats'
- throughput_last_30m:
- allOf:
- - $ref: '#/components/schemas/PercentileStats'
- - description: >-
- Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token
- generation speed. Only visible when authenticated with an API key or cookie; returns null for
- unauthenticated requests.
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
+ type: integer
+ search_context_size:
+ $ref: '#/components/schemas/SearchContextSizeEnum'
+ type:
+ enum:
+ - web_search_preview_2025_03_11
+ type: string
+ user_location:
+ $ref: '#/components/schemas/Preview_WebSearchUserLocation'
required:
- - name
- - model_id
- - model_name
- - context_length
- - pricing
- - provider_name
- - tag
- - quantization
- - max_completion_tokens
- - max_prompt_tokens
- - supported_parameters
- - uptime_last_30m
- - uptime_last_5m
- - uptime_last_1d
- - supports_implicit_caching
- - latency_last_30m
- - throughput_last_30m
- description: Information about a specific model endpoint
+ - type
+ type: object
+ Preview_WebSearchServerTool:
+ description: Web search preview tool configuration
example:
- name: 'OpenAI: GPT-4'
- model_id: openai/gpt-4
- model_name: GPT-4
- context_length: 8192
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- provider_name: OpenAI
- tag: openai
- quantization: fp16
- max_completion_tokens: 4096
- max_prompt_tokens: 8192
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- status: 0
- uptime_last_30m: 99.5
- uptime_last_5m: 100
- uptime_last_1d: 99.8
- supports_implicit_caching: true
- latency_last_30m:
- p50: 0.25
- p75: 0.35
- p90: 0.48
- p99: 0.85
- throughput_last_30m:
- p50: 45.2
- p75: 38.5
- p90: 28.3
- p99: 15.1
- ListEndpointsResponse:
- type: object
+ type: web_search_preview
properties:
- id:
- type: string
- description: Unique identifier for the model
- example: openai/gpt-4
- name:
- type: string
- description: Display name of the model
- example: GPT-4
- created:
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ filters:
+ $ref: '#/components/schemas/WebSearchDomainFilter'
+ max_results:
+ description: >-
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
type: integer
- description: Unix timestamp of when the model was created
- example: 1692901234
- description:
+ search_context_size:
+ $ref: '#/components/schemas/SearchContextSizeEnum'
+ type:
+ enum:
+ - web_search_preview
type: string
- description: Description of the model
- example: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- architecture:
- allOf:
- - $ref: '#/components/schemas/ModelArchitecture'
- - properties:
- tokenizer:
- allOf:
- - $ref: '#/components/schemas/ModelGroup'
- - nullable: true
- instruct_type:
- $ref: '#/components/schemas/InstructType'
- modality:
- type: string
- nullable: true
- description: Primary modality of the model
- example: text
- input_modalities:
- type: array
- items:
- $ref: '#/components/schemas/InputModality'
- description: Supported input modalities
- output_modalities:
- type: array
- items:
- $ref: '#/components/schemas/OutputModality'
- description: Supported output modalities
- required:
- - tokenizer
- - instruct_type
- - modality
- - input_modalities
- - output_modalities
- example:
- tokenizer: GPT
- instruct_type: chatml
- modality: text
- endpoints:
- type: array
- items:
- $ref: '#/components/schemas/PublicEndpoint'
- description: List of available endpoints for this model
+ user_location:
+ $ref: '#/components/schemas/Preview_WebSearchUserLocation'
required:
- - id
- - name
- - created
- - description
- - architecture
- - endpoints
- description: List of available endpoints for a model
+ - type
+ type: object
+ Preview_WebSearchUserLocation:
example:
- id: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- endpoints:
- - name: 'OpenAI: GPT-4'
- model_name: GPT-4
- context_length: 8192
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- provider_name: OpenAI
- tag: openai
- quantization: fp16
- max_completion_tokens: 4096
- max_prompt_tokens: 8192
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- - frequency_penalty
- - presence_penalty
- status: default
- uptime_last_30m: 99.5
- uptime_last_5m: 100
- uptime_last_1d: 99.8
- supports_implicit_caching: true
- latency_last_30m:
- p50: 0.25
- p75: 0.35
- p90: 0.48
- p99: 0.85
- throughput_last_30m:
- p50: 45.2
- p75: 38.5
- p90: 28.3
- p99: 15.1
- GuardrailInterval:
- type: string
+ city: San Francisco
+ country: USA
+ region: California
+ timezone: America/Los_Angeles
+ type: approximate
nullable: true
- enum:
- - daily
- - weekly
- - monthly
- - null
- description: Interval at which the limit resets (daily, weekly, monthly)
- example: monthly
- Guardrail:
- type: object
properties:
- id:
- type: string
- format: uuid
- description: Unique identifier for the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- name:
- type: string
- description: Name of the guardrail
- example: Production Guardrail
- description:
- type: string
- nullable: true
- description: Description of the guardrail
- example: Guardrail for production environment
- limit_usd:
- type: number
- format: double
- description: Spending limit in USD
- example: 100
- reset_interval:
- $ref: '#/components/schemas/GuardrailInterval'
- allowed_providers:
- type: array
+ city:
nullable: true
- items:
- type: string
- description: List of allowed provider IDs
- example:
- - openai
- - anthropic
- - google
- ignored_providers:
- type: array
+ type: string
+ country:
nullable: true
- items:
- type: string
- description: List of provider IDs to exclude from routing
- example:
- - azure
- allowed_models:
- type: array
+ type: string
+ region:
nullable: true
- items:
- type: string
- description: Array of model canonical_slugs (immutable identifiers)
- example:
- - openai/gpt-5.2-20251211
- - anthropic/claude-4.5-opus-20251124
- - deepseek/deepseek-r1-0528:free
- enforce_zdr:
- type: boolean
+ type: string
+ timezone:
nullable: true
- description: Whether to enforce zero data retention
- example: false
- created_at:
type: string
- description: ISO 8601 timestamp of when the guardrail was created
- example: '2025-08-24T10:30:00Z'
- updated_at:
+ type:
+ enum:
+ - approximate
type: string
- nullable: true
- description: ISO 8601 timestamp of when the guardrail was last updated
- example: '2025-08-24T15:45:00Z'
required:
- - id
- - name
- - created_at
- example:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: Production Guardrail
- description: Guardrail for production environment
- limit_usd: 100
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- ListGuardrailsResponse:
+ - type
type: object
+ ProviderName:
+ enum:
+ - AkashML
+ - AI21
+ - AionLabs
+ - Alibaba
+ - Ambient
+ - Amazon Bedrock
+ - Amazon Nova
+ - Anthropic
+ - Arcee AI
+ - AtlasCloud
+ - Avian
+ - Azure
+ - BaseTen
+ - BytePlus
+ - Black Forest Labs
+ - Cerebras
+ - Chutes
+ - Cirrascale
+ - Clarifai
+ - Cloudflare
+ - Cohere
+ - Crusoe
+ - DeepInfra
+ - DeepSeek
+ - Featherless
+ - Fireworks
+ - Friendli
+ - GMICloud
+ - Google
+ - Google AI Studio
+ - Groq
+ - Hyperbolic
+ - Inception
+ - Inceptron
+ - InferenceNet
+ - Ionstream
+ - Infermatic
+ - Io Net
+ - Inflection
+ - Liquid
+ - Mara
+ - Mancer 2
+ - Minimax
+ - ModelRun
+ - Mistral
+ - Modular
+ - Moonshot AI
+ - Morph
+ - NCompass
+ - Nebius
+ - NextBit
+ - Novita
+ - Nvidia
+ - OpenAI
+ - OpenInference
+ - Parasail
+ - Perplexity
+ - Phala
+ - Reka
+ - Relace
+ - SambaNova
+ - Seed
+ - SiliconFlow
+ - Sourceful
+ - StepFun
+ - Stealth
+ - StreamLake
+ - Switchpoint
+ - Together
+ - Upstage
+ - Venice
+ - WandB
+ - Xiaomi
+ - xAI
+ - Z.AI
+ - FakeProvider
+ example: OpenAI
+ type: string
+ ProviderOverloadedResponse:
+ description: Provider Overloaded - Provider is temporarily overloaded
+ example:
+ error:
+ code: 529
+ message: Provider returned error
properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/Guardrail'
- description: List of guardrails
- total_count:
- type: integer
- description: Total number of guardrails
- example: 25
+ error:
+ $ref: '#/components/schemas/ProviderOverloadedResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
required:
- - data
- - total_count
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- name: Production Guardrail
- description: Guardrail for production environment
- limit_usd: 100
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- total_count: 1
- CreateGuardrailResponse:
+ - error
type: object
+ ProviderOverloadedResponseErrorData:
+ description: Error data for ProviderOverloadedResponse
+ example:
+ code: 529
+ message: Provider returned error
properties:
- data:
- allOf:
- - $ref: '#/components/schemas/Guardrail'
- - description: The created guardrail
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
required:
- - data
- example:
- data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: My New Guardrail
- description: A guardrail for limiting API usage
- limit_usd: 50
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: null
- CreateGuardrailRequest:
+ - code
+ - message
type: object
+ ProviderPreferences:
+ additionalProperties: false
+ description: When multiple model providers are available, optionally indicate your routing preference.
+ example:
+ allow_fallbacks: true
+ nullable: true
properties:
- name:
- type: string
- minLength: 1
- maxLength: 200
- description: Name for the new guardrail
- example: My New Guardrail
- description:
- type: string
+ allow_fallbacks:
+ description: >
+ Whether to allow backup providers to serve requests
+
+ - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the
+ next best provider.
+
+ - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
nullable: true
- maxLength: 1000
- description: Description of the guardrail
- example: A guardrail for limiting API usage
- limit_usd:
- type: number
- format: double
- description: Spending limit in USD
- example: 50
- reset_interval:
- $ref: '#/components/schemas/GuardrailInterval'
- allowed_providers:
- type: array
+ type: boolean
+ data_collection:
+ description: >-
+ Data collection setting. If no available model provider meets the requirement, your request will return an
+ error.
+
+ - allow: (default) allow providers which store user data non-transiently and may train on it
+
+
+ - deny: use only providers which do not collect user data.
+ enum:
+ - deny
+ - allow
+ - null
+ example: allow
nullable: true
- items:
- type: string
- minItems: 1
- description: List of allowed provider IDs
+ type: string
+ enforce_distillable_text:
+ description: >-
+ Whether to restrict routing to only models that allow text distillation. When true, only models where the
+ author has allowed distillation will be used.
+ example: true
+ nullable: true
+ type: boolean
+ ignore:
+ description: >-
+ List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider
+ settings for this request.
example:
- openai
- anthropic
- - deepseek
- ignored_providers:
- type: array
- nullable: true
- items:
- type: string
- minItems: 1
- description: List of provider IDs to exclude from routing
- example:
- - azure
- allowed_models:
- type: array
- nullable: true
items:
- type: string
- minItems: 1
- description: Array of model identifiers (slug or canonical_slug accepted)
- example:
- - openai/gpt-5.2
- - anthropic/claude-4.5-opus-20251124
- - deepseek/deepseek-r1-0528:free
- enforce_zdr:
- type: boolean
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: string
nullable: true
- description: Whether to enforce zero data retention
- example: false
- required:
- - name
- example:
- name: My New Guardrail
- description: A guardrail for limiting API usage
- limit_usd: 50
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - deepseek
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- GetGuardrailResponse:
- type: object
- properties:
- data:
- allOf:
- - $ref: '#/components/schemas/Guardrail'
- - description: The guardrail
- required:
- - data
- example:
- data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: Production Guardrail
- description: Guardrail for production environment
- limit_usd: 100
- reset_interval: monthly
- allowed_providers:
+ type: array
+ max_price:
+ description: >-
+ The object specifying the maximum price you want to pay for this request. USD price per million tokens, for
+ prompt and completion.
+ properties:
+ audio:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: Price per audio unit
+ completion:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: Price per million completion tokens
+ image:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: Price per image
+ prompt:
+ $ref: '#/components/schemas/BigNumberUnion'
+ request:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: Price per request
+ type: object
+ only:
+ description: >-
+ List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider
+ settings for this request.
+ example:
- openai
- anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- UpdateGuardrailResponse:
- type: object
- properties:
- data:
- allOf:
- - $ref: '#/components/schemas/Guardrail'
- - description: The updated guardrail
- required:
- - data
- example:
- data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: Updated Guardrail Name
- description: Updated description
- limit_usd: 75
- reset_interval: weekly
- allowed_providers:
- - openai
- ignored_providers: null
- allowed_models: null
- enforce_zdr: true
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T16:00:00Z'
- UpdateGuardrailRequest:
- type: object
- properties:
- name:
- type: string
- minLength: 1
- maxLength: 200
- description: New name for the guardrail
- example: Updated Guardrail Name
- description:
- type: string
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: string
nullable: true
- maxLength: 1000
- description: New description for the guardrail
- example: Updated description
- limit_usd:
- type: number
- format: double
- description: New spending limit in USD
- example: 75
- reset_interval:
- $ref: '#/components/schemas/GuardrailInterval'
- allowed_providers:
type: array
- nullable: true
- items:
- type: string
- minItems: 1
- description: New list of allowed provider IDs
+ order:
+ description: >-
+ 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.
example:
- openai
- anthropic
- - deepseek
- ignored_providers:
- type: array
+ items:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderName'
+ - type: string
nullable: true
+ type: array
+ preferred_max_latency:
+ $ref: '#/components/schemas/PreferredMaxLatency'
+ preferred_min_throughput:
+ $ref: '#/components/schemas/PreferredMinThroughput'
+ quantizations:
+ description: A list of quantization levels to filter the provider by.
items:
- type: string
- minItems: 1
- description: List of provider IDs to exclude from routing
- example:
- - azure
- allowed_models:
+ $ref: '#/components/schemas/Quantization'
+ nullable: true
type: array
+ require_parameters:
+ description: >-
+ 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.
nullable: true
- items:
- type: string
- minItems: 1
- description: Array of model identifiers (slug or canonical_slug accepted)
- example:
- - openai/gpt-5.2
- enforce_zdr:
type: boolean
- nullable: true
- description: Whether to enforce zero data retention
+ sort:
+ anyOf:
+ - $ref: '#/components/schemas/ProviderSort'
+ - $ref: '#/components/schemas/ProviderSortConfig'
+ - nullable: true
+ description: >-
+ The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is
+ performed.
+ example: price
+ zdr:
+ description: >-
+ Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do
+ not retain prompts will be used.
example: true
- example:
- name: Updated Guardrail Name
- description: Updated description
- limit_usd: 75
- reset_interval: weekly
- DeleteGuardrailResponse:
- type: object
- properties:
- deleted:
+ nullable: true
type: boolean
- const: true
- description: Confirmation that the guardrail was deleted
- example: true
- required:
- - deleted
- example:
- deleted: true
- KeyAssignment:
type: object
+ ProviderResponse:
+ description: Details of a provider response for a generation attempt
+ example:
+ endpoint_id: ep_abc123
+ id: chatcmpl-abc123
+ is_byok: false
+ latency: 1200
+ model_permaslug: openai/gpt-4
+ provider_name: OpenAI
+ status: 200
properties:
- id:
- type: string
- format: uuid
- description: Unique identifier for the assignment
- example: 550e8400-e29b-41d4-a716-446655440000
- key_hash:
- type: string
- description: Hash of the assigned API key
- example: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- guardrail_id:
- type: string
- format: uuid
- description: ID of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440001
- key_name:
- type: string
- description: Name of the API key
- example: Production Key
- key_label:
+ endpoint_id:
+ description: Internal endpoint identifier
+ example: ep_abc123
type: string
- description: Label of the API key
- example: prod-key
- assigned_by:
+ id:
+ description: Upstream provider response identifier
+ example: chatcmpl-abc123
type: string
- nullable: true
- description: User ID of who made the assignment
- example: user_abc123
- created_at:
+ is_byok:
+ description: Whether the request used a bring-your-own-key
+ example: false
+ type: boolean
+ latency:
+ description: Response latency in milliseconds
+ example: 1200
+ type: number
+ model_permaslug:
+ description: Canonical model slug
+ example: openai/gpt-4
type: string
- description: ISO 8601 timestamp of when the assignment was created
- example: '2025-08-24T10:30:00Z'
- required:
- - id
- - key_hash
- - guardrail_id
- - key_name
- - key_label
- - assigned_by
- - created_at
- example:
- id: 550e8400-e29b-41d4-a716-446655440000
- key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- key_name: Production Key
- key_label: prod-key
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- ListKeyAssignmentsResponse:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/KeyAssignment'
- description: List of key assignments
- total_count:
- type: integer
- description: Total number of key assignments for this guardrail
- example: 25
+ provider_name:
+ description: Name of the provider
+ enum:
+ - AnyScale
+ - Atoma
+ - Cent-ML
+ - CrofAI
+ - Enfer
+ - GoPomelo
+ - HuggingFace
+ - Hyperbolic 2
+ - InoCloud
+ - Kluster
+ - Lambda
+ - Lepton
+ - Lynn 2
+ - Lynn
+ - Mancer
+ - Meta
+ - Modal
+ - Nineteen
+ - OctoAI
+ - Recursal
+ - Reflection
+ - Replicate
+ - SambaNova 2
+ - SF Compute
+ - Targon
+ - Together 2
+ - Ubicloud
+ - 01.AI
+ - AkashML
+ - AI21
+ - AionLabs
+ - Alibaba
+ - Ambient
+ - Amazon Bedrock
+ - Amazon Nova
+ - Anthropic
+ - Arcee AI
+ - AtlasCloud
+ - Avian
+ - Azure
+ - BaseTen
+ - BytePlus
+ - Black Forest Labs
+ - Cerebras
+ - Chutes
+ - Cirrascale
+ - Clarifai
+ - Cloudflare
+ - Cohere
+ - Crusoe
+ - DeepInfra
+ - DeepSeek
+ - Featherless
+ - Fireworks
+ - Friendli
+ - GMICloud
+ - Google
+ - Google AI Studio
+ - Groq
+ - Hyperbolic
+ - Inception
+ - Inceptron
+ - InferenceNet
+ - Ionstream
+ - Infermatic
+ - Io Net
+ - Inflection
+ - Liquid
+ - Mara
+ - Mancer 2
+ - Minimax
+ - ModelRun
+ - Mistral
+ - Modular
+ - Moonshot AI
+ - Morph
+ - NCompass
+ - Nebius
+ - NextBit
+ - Novita
+ - Nvidia
+ - OpenAI
+ - OpenInference
+ - Parasail
+ - Perplexity
+ - Phala
+ - Reka
+ - Relace
+ - SambaNova
+ - Seed
+ - SiliconFlow
+ - Sourceful
+ - StepFun
+ - Stealth
+ - StreamLake
+ - Switchpoint
+ - Together
+ - Upstage
+ - Venice
+ - WandB
+ - Xiaomi
+ - xAI
+ - Z.AI
+ - FakeProvider
+ example: OpenAI
+ type: string
+ status:
+ description: HTTP status code from the provider
+ example: 200
+ nullable: true
+ type: number
required:
- - data
- - total_count
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- key_name: Production Key
- key_label: prod-key
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- total_count: 1
- MemberAssignment:
+ - status
type: object
+ ProviderSort:
+ description: The provider sorting strategy (price, throughput, latency)
+ enum:
+ - price
+ - throughput
+ - latency
+ - exacto
+ example: price
+ type: string
+ ProviderSortConfig:
+ description: The provider sorting strategy (price, throughput, latency)
+ example:
+ by: price
+ partition: model
properties:
- id:
- type: string
- format: uuid
- description: Unique identifier for the assignment
- example: 550e8400-e29b-41d4-a716-446655440000
- user_id:
- type: string
- description: Clerk user ID of the assigned member
- example: user_abc123
- organization_id:
- type: string
- description: Organization ID
- example: org_xyz789
- guardrail_id:
- type: string
- format: uuid
- description: ID of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440001
- assigned_by:
+ by:
+ description: The provider sorting strategy (price, throughput, latency)
+ enum:
+ - price
+ - throughput
+ - latency
+ - exacto
+ - null
+ example: price
+ nullable: true
type: string
+ partition:
+ description: >-
+ Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback
+ models remain fallbacks), "none" sorts all endpoints together regardless of model.
+ enum:
+ - model
+ - none
+ - null
+ example: model
nullable: true
- description: User ID of who made the assignment
- example: user_abc123
- created_at:
type: string
- description: ISO 8601 timestamp of when the assignment was created
- example: '2025-08-24T10:30:00Z'
- required:
- - id
- - user_id
- - organization_id
- - guardrail_id
- - assigned_by
- - created_at
- example:
- id: 550e8400-e29b-41d4-a716-446655440000
- user_id: user_abc123
- organization_id: org_xyz789
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- ListMemberAssignmentsResponse:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/MemberAssignment'
- description: List of member assignments
- total_count:
- type: integer
- description: Total number of member assignments
- example: 10
- required:
- - data
- - total_count
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- user_id: user_abc123
- organization_id: org_xyz789
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- total_count: 1
- BulkAssignKeysResponse:
type: object
- properties:
- assigned_count:
- type: integer
- description: Number of keys successfully assigned
- example: 3
- required:
- - assigned_count
+ PublicEndpoint:
+ description: Information about a specific model endpoint
example:
- assigned_count: 3
- BulkAssignKeysRequest:
- type: object
- properties:
- key_hashes:
- type: array
- items:
- type: string
- minLength: 1
- minItems: 1
- description: Array of API key hashes to assign to the guardrail
- example:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- required:
- - key_hashes
- example:
- key_hashes:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- BulkAssignMembersResponse:
- type: object
+ context_length: 8192
+ latency_last_30m:
+ p50: 0.25
+ p75: 0.35
+ p90: 0.48
+ p99: 0.85
+ max_completion_tokens: 4096
+ max_prompt_tokens: 8192
+ model_id: openai/gpt-4
+ model_name: GPT-4
+ name: 'OpenAI: GPT-4'
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ provider_name: OpenAI
+ quantization: fp16
+ status: 0
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ supports_implicit_caching: true
+ tag: openai
+ throughput_last_30m:
+ p50: 45.2
+ p75: 38.5
+ p90: 28.3
+ p99: 15.1
+ uptime_last_1d: 99.8
+ uptime_last_30m: 99.5
+ uptime_last_5m: 100
properties:
- assigned_count:
+ context_length:
type: integer
- description: Number of members successfully assigned
- example: 2
- required:
- - assigned_count
- example:
- assigned_count: 2
- BulkAssignMembersRequest:
- type: object
- properties:
- member_user_ids:
- type: array
- items:
- type: string
- minLength: 1
- minItems: 1
- description: Array of member user IDs to assign to the guardrail
- example:
- - user_abc123
- - user_def456
- required:
- - member_user_ids
- example:
- member_user_ids:
- - user_abc123
- - user_def456
- BulkUnassignKeysResponse:
- type: object
- properties:
- unassigned_count:
+ latency_last_30m:
+ $ref: '#/components/schemas/PercentileStats'
+ max_completion_tokens:
type: integer
- description: Number of keys successfully unassigned
- example: 3
- required:
- - unassigned_count
- example:
- unassigned_count: 3
- BulkUnassignKeysRequest:
- type: object
- properties:
- key_hashes:
- type: array
+ max_prompt_tokens:
+ type: integer
+ model_id:
+ description: The unique identifier for the model (permaslug)
+ example: openai/gpt-4
+ type: string
+ model_name:
+ type: string
+ name:
+ type: string
+ pricing:
+ properties:
+ audio:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ audio_output:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ completion:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ discount:
+ type: number
+ image:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ image_output:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ image_token:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_audio_cache:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_cache_read:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_cache_write:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ internal_reasoning:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ prompt:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ request:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ web_search:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ required:
+ - prompt
+ - completion
+ type: object
+ provider_name:
+ $ref: '#/components/schemas/ProviderName'
+ quantization:
+ allOf:
+ - $ref: '#/components/schemas/Quantization'
+ - nullable: true
+ status:
+ $ref: '#/components/schemas/EndpointStatus'
+ supported_parameters:
items:
- type: string
- minLength: 1
- minItems: 1
- description: Array of API key hashes to unassign from the guardrail
- example:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ $ref: '#/components/schemas/Parameter'
+ type: array
+ supports_implicit_caching:
+ type: boolean
+ tag:
+ type: string
+ throughput_last_30m:
+ allOf:
+ - $ref: '#/components/schemas/PercentileStats'
+ - description: >-
+ Throughput percentiles in tokens per second over the last 30 minutes. Throughput measures output token
+ generation speed. Only visible when authenticated with an API key or cookie; returns null for
+ unauthenticated requests.
+ uptime_last_1d:
+ description: >-
+ Uptime percentage over the last 1 day, calculated as successful requests / (successful + error requests) *
+ 100. Rate-limited requests are excluded. Returns null if insufficient data.
+ format: double
+ type: number
+ uptime_last_30m:
+ format: double
+ type: number
+ uptime_last_5m:
+ description: >-
+ Uptime percentage over the last 5 minutes, calculated as successful requests / (successful + error requests)
+ * 100. Rate-limited requests are excluded. Returns null if insufficient data.
+ format: double
+ type: number
required:
- - key_hashes
- example:
- key_hashes:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- BulkUnassignMembersResponse:
+ - name
+ - model_id
+ - model_name
+ - context_length
+ - pricing
+ - provider_name
+ - tag
+ - quantization
+ - max_completion_tokens
+ - max_prompt_tokens
+ - supported_parameters
+ - uptime_last_30m
+ - uptime_last_5m
+ - uptime_last_1d
+ - supports_implicit_caching
+ - latency_last_30m
+ - throughput_last_30m
type: object
- properties:
- unassigned_count:
- type: integer
- description: Number of members successfully unassigned
- example: 2
- required:
- - unassigned_count
+ PublicPricing:
+ description: Pricing information for the model
example:
- unassigned_count: 2
- BulkUnassignMembersRequest:
- type: object
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
properties:
- member_user_ids:
- type: array
- items:
- type: string
- minLength: 1
- minItems: 1
- description: Array of member user IDs to unassign from the guardrail
- example:
- - user_abc123
- - user_def456
- required:
- - member_user_ids
- example:
- member_user_ids:
- - user_abc123
- - user_def456
- ConflictResponseErrorData:
+ audio:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ audio_output:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ completion:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ discount:
+ type: number
+ image:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ image_output:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ image_token:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_audio_cache:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_cache_read:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ input_cache_write:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ internal_reasoning:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ prompt:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ request:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ web_search:
+ allOf:
+ - $ref: '#/components/schemas/BigNumberUnion'
+ - description: A number or string value representing a large number
+ required:
+ - prompt
+ - completion
type: object
+ Quantization:
+ enum:
+ - int4
+ - int8
+ - fp4
+ - fp6
+ - fp8
+ - fp16
+ - bf16
+ - fp32
+ - unknown
+ example: fp16
+ type: string
+ ReasoningConfig:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningConfig'
+ - nullable: true
+ properties:
+ enabled:
+ nullable: true
+ type: boolean
+ max_tokens:
+ type: integer
+ type: object
+ description: Configuration for reasoning mode in the response
+ example:
+ enabled: true
+ summary: auto
+ ReasoningDeltaEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningDeltaEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when reasoning text delta is streamed
+ example:
+ content_index: 0
+ delta: First, we need
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ type: response.reasoning_text.delta
+ ReasoningDetailEncrypted:
+ description: Reasoning detail encrypted schema
+ example:
+ data: encrypted data
+ type: reasoning.encrypted
properties:
- code:
- type: integer
- message:
+ data:
type: string
- metadata:
- type: object
+ format:
+ $ref: '#/components/schemas/ReasoningFormat'
+ id:
nullable: true
- additionalProperties:
- nullable: true
+ type: string
+ index:
+ type: integer
+ type:
+ enum:
+ - reasoning.encrypted
+ type: string
required:
- - code
- - message
- description: Error data for ConflictResponse
+ - type
+ - data
+ type: object
+ ReasoningDetailSummary:
+ description: Reasoning detail summary schema
example:
- code: 409
- message: Resource conflict. Please try again later.
- ConflictResponse:
+ summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
+ type: reasoning.summary
+ properties:
+ format:
+ $ref: '#/components/schemas/ReasoningFormat'
+ id:
+ nullable: true
+ type: string
+ index:
+ type: integer
+ summary:
+ type: string
+ type:
+ enum:
+ - reasoning.summary
+ type: string
+ required:
+ - type
+ - summary
type: object
+ ReasoningDetailText:
+ description: Reasoning detail text schema
+ example:
+ signature: signature
+ text: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
+ type: reasoning.text
properties:
- error:
- $ref: '#/components/schemas/ConflictResponseErrorData'
- user_id:
+ format:
+ $ref: '#/components/schemas/ReasoningFormat'
+ id:
+ nullable: true
+ type: string
+ index:
+ type: integer
+ signature:
+ nullable: true
type: string
+ text:
nullable: true
+ type: string
+ type:
+ enum:
+ - reasoning.text
+ type: string
required:
- - error
- description: Conflict - Resource conflict or concurrent modification
+ - type
+ type: object
+ ReasoningDetailUnion:
+ description: Reasoning detail union schema
+ discriminator:
+ mapping:
+ reasoning.encrypted: '#/components/schemas/ReasoningDetailEncrypted'
+ reasoning.summary: '#/components/schemas/ReasoningDetailSummary'
+ reasoning.text: '#/components/schemas/ReasoningDetailText'
+ propertyName: type
example:
- error:
- code: 409
- message: Resource conflict. Please try again later.
- parameters: {}
- securitySchemes:
- apiKey:
- type: http
- scheme: bearer
- description: API key as bearer token in Authorization header
- bearer:
- type: http
- scheme: bearer
- description: API key as bearer token in Authorization header
-paths:
- /responses:
- post:
- x-speakeasy-name-override: send
- x-speakeasy-stream-request-field: stream
- tags:
- - beta.responses
- summary: Create a response
- description: Creates a streaming or non-streaming response using OpenResponses API format
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ResponsesRequest'
- example:
- model: openai/gpt-4o
- input: Tell me a joke
- required: true
- responses:
- '200':
- description: Successful response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/OpenResponsesResult'
- example:
- id: resp_abc123
- object: response
- created_at: 1700000000
- status: completed
- output:
- - type: message
- role: assistant
- content:
- - type: output_text
- text: Why did the chicken cross the road? To get to the other side!
- model: openai/gpt-4o
- usage:
- prompt_tokens: 10
- completion_tokens: 20
- total_tokens: 30
- text/event-stream:
- schema:
- type: object
- properties:
- data:
- $ref: '#/components/schemas/StreamEvents'
- required:
- - data
- x-speakeasy-sse-sentinel: '[DONE]'
- example:
- data:
- type: response.output_text.delta
- delta: Hello
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '402':
- description: Payment Required - Insufficient credits or quota to complete request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PaymentRequiredResponse'
- example:
- error:
- code: 402
- message: Insufficient credits. Add more using https://openrouter.ai/credits
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '408':
- description: Request Timeout - Operation exceeded time limit
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RequestTimeoutResponse'
- example:
- error:
- code: 408
- message: Operation timed out. Please try again later.
- '413':
- description: Payload Too Large - Request payload exceeds size limits
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PayloadTooLargeResponse'
- example:
- error:
- code: 413
- message: Request payload too large
- '422':
- description: Unprocessable Entity - Semantic validation failure
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnprocessableEntityResponse'
- example:
- error:
- code: 422
- message: Invalid argument
- '429':
- description: Too Many Requests - Rate limit exceeded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
- example:
- error:
- code: 429
- message: Rate limit exceeded
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- '502':
- description: Bad Gateway - Provider/upstream API failure
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadGatewayResponse'
- example:
- error:
- code: 502
- message: Provider returned error
- '503':
- description: Service Unavailable - Service temporarily unavailable
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ServiceUnavailableResponse'
- example:
- error:
- code: 503
- message: Service temporarily unavailable
- '524':
- description: Infrastructure Timeout - Provider request timed out at edge network
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
- example:
- error:
- code: 524
- message: Request timed out. Please try again later.
- '529':
- description: Provider Overloaded - Provider is temporarily overloaded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProviderOverloadedResponse'
- example:
- error:
- code: 529
- message: Provider returned error
- operationId: createResponses
- /messages:
- post:
- x-speakeasy-ignore: true
- x-speakeasy-name-override: create
- x-speakeasy-stream-request-field: stream
- tags:
- - Anthropic Messages
- summary: Create a message
- description: >-
- Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended
- thinking.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesRequest'
- example:
- model: anthropic/claude-sonnet-4
- max_tokens: 1024
- messages:
- - role: user
- content: Hello, how are you?
- required: true
- responses:
- '200':
- description: Successful response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesResult'
- example:
- id: msg_abc123
- type: message
- role: assistant
- content:
- - type: text
- text: I'm doing well, thank you for asking! How can I help you today?
- model: anthropic/claude-sonnet-4
- stop_reason: end_turn
- usage:
- input_tokens: 12
- output_tokens: 18
- text/event-stream:
- schema:
- type: object
- properties:
- event:
- type: string
- data:
- $ref: '#/components/schemas/MessagesStreamEvents'
- required:
- - event
- - data
- x-speakeasy-sse-sentinel: '[DONE]'
- example:
- event: content_block_delta
- data:
- type: content_block_delta
- index: 0
- delta:
- type: text_delta
- text: Hello
- '400':
- description: Invalid request error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: invalid_request_error
- message: 'Invalid request: messages is required'
- '401':
- description: Authentication error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: authentication_error
- message: Invalid API key
- '403':
- description: Permission denied error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: permission_error
- message: Permission denied
- '404':
- description: Not found error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: not_found_error
- message: Model not found
- '429':
- description: Rate limit error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: rate_limit_error
- message: Rate limit exceeded
- '500':
- description: API error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: api_error
- message: Internal server error
- '503':
- description: Overloaded error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: overloaded_error
- message: Service temporarily overloaded
- '529':
- description: Overloaded error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/MessagesErrorResponse'
- example:
- type: error
- error:
- type: overloaded_error
- message: Provider is temporarily overloaded
- operationId: createMessages
- /activity:
- get:
- tags:
- - Analytics
- operationId: getUserActivity
- summary: Get user activity grouped by endpoint
- description: >-
- Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- parameters:
- - schema:
- type: string
- description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
- example: '2025-08-24'
- required: false
- description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
- name: date
- in: query
- - schema:
- type: string
- description: Filter by API key hash (SHA-256 hex string, as returned by the keys API).
- example: abc123def456...
- required: false
- description: Filter by API key hash (SHA-256 hex string, as returned by the keys API).
- name: api_key_hash
- in: query
- - schema:
- type: string
- description: Filter by org member user ID. Only applicable for organization accounts.
- example: user_abc123
- required: false
- description: Filter by org member user ID. Only applicable for organization accounts.
- name: user_id
- in: query
- responses:
- '200':
- description: Returns user activity data grouped by endpoint
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ActivityResponse'
- example:
- data:
- - date: '2025-08-24'
- model: openai/gpt-4.1
- model_permaslug: openai/gpt-4.1-2025-04-14
- endpoint_id: 550e8400-e29b-41d4-a716-446655440000
- provider_name: OpenAI
- usage: 0.015
- byok_usage_inference: 0.012
- requests: 5
- prompt_tokens: 50
- completion_tokens: 125
- reasoning_tokens: 25
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '403':
- description: Forbidden - Authentication successful but insufficient permissions
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ForbiddenResponse'
- example:
- error:
- code: 403
- message: Only management keys can perform this operation
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /chat/completions:
- post:
- x-speakeasy-group: chat
- x-speakeasy-name-override: send
- x-speakeasy-stream-request-field: stream
- tags:
- - Chat
- summary: Create a chat completion
- operationId: sendChatCompletionRequest
- description: >-
- Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming
- modes.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatRequest'
- example:
- model: openai/gpt-4
- messages:
- - role: system
- content: You are a helpful assistant.
- - role: user
- content: What is the capital of France?
- temperature: 0.7
- max_tokens: 150
- required: true
- responses:
- '200':
- description: Successful chat completion response
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ChatResult'
- example:
- id: chatcmpl-123
- object: chat.completion
- created: 1677652288
- model: openai/gpt-4
- choices:
- - index: 0
- message:
- role: assistant
- content: The capital of France is Paris.
- finish_reason: stop
- usage:
- prompt_tokens: 25
- completion_tokens: 10
- total_tokens: 35
- text/event-stream:
- schema:
- type: object
- properties:
- data:
- $ref: '#/components/schemas/ChatStreamChunk'
- required:
- - data
- x-speakeasy-sse-sentinel: '[DONE]'
- example:
- data:
- id: chatcmpl-123
- object: chat.completion.chunk
- created: 1677652288
- model: openai/gpt-4
- choices:
- - index: 0
- delta:
- role: assistant
- content: Hello
- finish_reason: null
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '402':
- description: Payment Required - Insufficient credits or quota to complete request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PaymentRequiredResponse'
- example:
- error:
- code: 402
- message: Insufficient credits. Add more using https://openrouter.ai/credits
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '408':
- description: Request Timeout - Operation exceeded time limit
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/RequestTimeoutResponse'
- example:
- error:
- code: 408
- message: Operation timed out. Please try again later.
- '413':
- description: Payload Too Large - Request payload exceeds size limits
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PayloadTooLargeResponse'
- example:
- error:
- code: 413
- message: Request payload too large
- '422':
- description: Unprocessable Entity - Semantic validation failure
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnprocessableEntityResponse'
- example:
- error:
- code: 422
- message: Invalid argument
- '429':
- description: Too Many Requests - Rate limit exceeded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
- example:
- error:
- code: 429
- message: Rate limit exceeded
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- '502':
- description: Bad Gateway - Provider/upstream API failure
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadGatewayResponse'
- example:
- error:
- code: 502
- message: Provider returned error
- '503':
- description: Service Unavailable - Service temporarily unavailable
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ServiceUnavailableResponse'
- example:
- error:
- code: 503
- message: Service temporarily unavailable
- '524':
- description: Infrastructure Timeout - Provider request timed out at edge network
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
- example:
- error:
- code: 524
- message: Request timed out. Please try again later.
- '529':
- description: Provider Overloaded - Provider is temporarily overloaded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProviderOverloadedResponse'
- example:
- error:
- code: 529
- message: Provider returned error
- /credits:
- get:
- x-speakeasy-name-override: getCredits
- tags:
- - Credits
- summary: Get remaining credits
- operationId: getCredits
- description: >-
- Get total credits purchased and used for the authenticated user. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- responses:
- '200':
- description: Returns the total credits purchased and used
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- total_credits:
- type: number
- format: double
- description: Total credits purchased
- example: 100.5
- total_usage:
- type: number
- format: double
- description: Total credits used
- example: 25.75
- required:
- - total_credits
- - total_usage
- example:
- total_credits: 100.5
- total_usage: 25.75
- required:
- - data
- description: Total credits purchased and used
- example:
- data:
- total_credits: 100.5
- total_usage: 25.75
- example:
- data:
- total_credits: 100.5
- total_usage: 25.75
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '403':
- description: Forbidden - Authentication successful but insufficient permissions
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ForbiddenResponse'
- example:
- error:
- code: 403
- message: Only management keys can perform this operation
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /credits/coinbase:
- post:
- security: []
- x-speakeasy-name-override: createCoinbaseCharge
- x-speakeasy-ignore: true
- x-fern-ignore: true
- deprecated: true
- tags:
- - Credits
- summary: Deprecated Coinbase Commerce charge endpoint
- operationId: createCoinbaseCharge
- description: >-
- Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been
- removed. Use the web credits purchase flow instead.
- responses:
- '200':
- description: This endpoint is deprecated and will never return a 200 response.
- '410':
- description: Gone - Endpoint has been permanently removed or deprecated
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GoneResponse'
- example:
- error:
- code: 410
- message: >-
- The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API
- has been removed. Use the web credits purchase flow instead.
- /generation:
- get:
- tags:
- - Generations
- summary: Get request & usage metadata for a generation
- parameters:
- - schema:
- type: string
- minLength: 1
- description: The generation ID
- example: gen-1234567890
- required: true
- description: The generation ID
- name: id
- in: query
- responses:
- '200':
- description: Returns the request metadata for this generation
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- description: Unique identifier for the generation
- example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
- upstream_id:
- type: string
- nullable: true
- description: Upstream provider's identifier for this generation
- example: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
- total_cost:
- type: number
- format: double
- description: Total cost of the generation in USD
- example: 0.0015
- cache_discount:
- type: number
- format: double
- description: Discount applied due to caching
- example: 0.0002
- upstream_inference_cost:
- type: number
- format: double
- description: Cost charged by the upstream provider
- example: 0.0012
- created_at:
- type: string
- description: ISO 8601 timestamp of when the generation was created
- example: '2024-07-15T23:33:19.433273+00:00'
- model:
- type: string
- description: Model used for the generation
- example: sao10k/l3-stheno-8b
- app_id:
- type: integer
- description: ID of the app that made the request
- example: 12345
- streamed:
- type: boolean
- nullable: true
- description: Whether the response was streamed
- example: true
- cancelled:
- type: boolean
- nullable: true
- description: Whether the generation was cancelled
- example: false
- provider_name:
- type: string
- nullable: true
- description: Name of the provider that served the request
- example: Infermatic
- latency:
- type: number
- format: double
- description: Total latency in milliseconds
- example: 1250
- moderation_latency:
- type: number
- format: double
- description: Moderation latency in milliseconds
- example: 50
- generation_time:
- type: number
- format: double
- description: Time taken for generation in milliseconds
- example: 1200
- finish_reason:
- type: string
- nullable: true
- description: Reason the generation finished
- example: stop
- tokens_prompt:
- type: integer
- description: Number of tokens in the prompt
- example: 10
- tokens_completion:
- type: integer
- description: Number of tokens in the completion
- example: 25
- native_tokens_prompt:
- type: integer
- description: Native prompt tokens as reported by provider
- example: 10
- native_tokens_completion:
- type: integer
- description: Native completion tokens as reported by provider
- example: 25
- native_tokens_completion_images:
- type: integer
- description: Native completion image tokens as reported by provider
- example: 0
- native_tokens_reasoning:
- type: integer
- description: Native reasoning tokens as reported by provider
- example: 5
- native_tokens_cached:
- type: integer
- description: Native cached tokens as reported by provider
- example: 3
- num_media_prompt:
- type: integer
- description: Number of media items in the prompt
- example: 1
- num_input_audio_prompt:
- type: integer
- description: Number of audio inputs in the prompt
- example: 0
- num_media_completion:
- type: integer
- description: Number of media items in the completion
- example: 0
- num_search_results:
- type: integer
- description: Number of search results included
- example: 5
- origin:
- type: string
- description: Origin URL of the request
- example: https://openrouter.ai/
- usage:
- type: number
- format: double
- description: Usage amount in USD
- example: 0.0015
- is_byok:
- type: boolean
- description: Whether this used bring-your-own-key
- example: false
- native_finish_reason:
- type: string
- nullable: true
- description: Native finish reason as reported by provider
- example: stop
- external_user:
- type: string
- nullable: true
- description: External user identifier
- example: user-123
- api_type:
- type: string
- nullable: true
- enum:
- - completions
- - embeddings
- - rerank
- - video
- - null
- description: Type of API used for the generation
- router:
- type: string
- nullable: true
- description: Router used for the request (e.g., openrouter/auto)
- example: openrouter/auto
- provider_responses:
- type: array
- nullable: true
- items:
- $ref: '#/components/schemas/ProviderResponse'
- description: List of provider responses for this generation, including fallback attempts
- user_agent:
- type: string
- nullable: true
- description: User-Agent header from the request
- http_referer:
- type: string
- nullable: true
- description: Referer header from the request
- request_id:
- type: string
- nullable: true
- description: Unique identifier grouping all generations from a single API request
- example: req-1727282430-aBcDeFgHiJkLmNoPqRsT
- session_id:
- type: string
- nullable: true
- description: Session identifier grouping multiple generations in the same session
- required:
- - id
- - upstream_id
- - total_cost
- - cache_discount
- - upstream_inference_cost
- - created_at
- - model
- - app_id
- - streamed
- - cancelled
- - provider_name
- - latency
- - moderation_latency
- - generation_time
- - finish_reason
- - tokens_prompt
- - tokens_completion
- - native_tokens_prompt
- - native_tokens_completion
- - native_tokens_completion_images
- - native_tokens_reasoning
- - native_tokens_cached
- - num_media_prompt
- - num_input_audio_prompt
- - num_media_completion
- - num_search_results
- - origin
- - usage
- - is_byok
- - native_finish_reason
- - external_user
- - api_type
- - router
- - provider_responses
- - user_agent
- - http_referer
- description: Generation data
- required:
- - data
- description: Generation response
- example:
- data:
- id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
- upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
- total_cost: 0.0015
- cache_discount: 0.0002
- upstream_inference_cost: 0.0012
- created_at: '2024-07-15T23:33:19.433273+00:00'
- model: sao10k/l3-stheno-8b
- app_id: 12345
- streamed: true
- cancelled: false
- provider_name: Infermatic
- latency: 1250
- moderation_latency: 50
- generation_time: 1200
- finish_reason: stop
- tokens_prompt: 10
- tokens_completion: 25
- native_tokens_prompt: 10
- native_tokens_completion: 25
- native_tokens_completion_images: 0
- native_tokens_reasoning: 5
- native_tokens_cached: 3
- num_media_prompt: 1
- num_input_audio_prompt: 0
- num_media_completion: 0
- num_search_results: 5
- origin: https://openrouter.ai/
- usage: 0.0015
- is_byok: false
- native_finish_reason: stop
- external_user: user-123
- api_type: null
- router: null
- provider_responses: null
- user_agent: null
- http_referer: null
- request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '402':
- description: Payment Required - Insufficient credits or quota to complete request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/PaymentRequiredResponse'
- example:
- error:
- code: 402
- message: Insufficient credits. Add more using https://openrouter.ai/credits
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '429':
- description: Too Many Requests - Rate limit exceeded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
- example:
- error:
- code: 429
- message: Rate limit exceeded
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- '502':
- description: Bad Gateway - Provider/upstream API failure
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadGatewayResponse'
- example:
- error:
- code: 502
- message: Provider returned error
- '524':
- description: Infrastructure Timeout - Provider request timed out at edge network
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
- example:
- error:
- code: 524
- message: Request timed out. Please try again later.
- '529':
- description: Provider Overloaded - Provider is temporarily overloaded
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ProviderOverloadedResponse'
- example:
- error:
- code: 529
- message: Provider returned error
- operationId: getGeneration
- /models/count:
- get:
- tags:
- - Models
- x-speakeasy-name-override: count
- summary: Get total count of available models
- parameters:
- - schema:
- type: string
- description: >-
- Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
- embeddings) or "all" to include all models. Defaults to "text".
- example: text
- required: false
- description: >-
- Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
- embeddings) or "all" to include all models. Defaults to "text".
- name: output_modalities
- in: query
- responses:
- '200':
- description: Returns the total count of available models
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ModelsCountResponse'
- example:
- data:
- count: 150
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- operationId: listModelsCount
- /models:
- get:
- tags:
- - Models
- x-speakeasy-name-override: list
- summary: List all models and their properties
- parameters:
- - schema:
- type: string
- enum:
- - programming
- - roleplay
- - marketing
- - marketing/seo
- - technology
- - science
- - translation
- - legal
- - finance
- - health
- - trivia
- - academia
- description: Filter models by use case category
- example: programming
- required: false
- description: Filter models by use case category
- name: category
- in: query
- - schema:
- type: string
- description: Filter models by supported parameter (comma-separated)
- example: temperature
- required: false
- description: Filter models by supported parameter (comma-separated)
- name: supported_parameters
- in: query
- - schema:
- type: string
- description: >-
- Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
- embeddings) or "all" to include all models. Defaults to "text".
- example: text
- required: false
- description: >-
- Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
- embeddings) or "all" to include all models. Defaults to "text".
- name: output_modalities
- in: query
- - schema:
- type: string
- description: Return results as RSS feed
- example: 'true'
- required: false
- description: Return results as RSS feed
- name: use_rss
- in: query
- - schema:
- type: string
- description: Use chat links in RSS feed items
- example: 'true'
- required: false
- description: Use chat links in RSS feed items
- name: use_rss_chat_links
- in: query
- responses:
- '200':
- description: Returns a list of models or RSS feed
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ModelsListResponse'
- example:
- data:
- - id: openai/gpt-4
- canonical_slug: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- top_provider:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- per_request_limits: null
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- application/rss+xml:
- schema:
- type: string
- example: >-
- OpenRouter
- Models
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- operationId: getModels
- /models/user:
- get:
- tags:
- - Models
- x-speakeasy-name-override: listForUser
- description: >-
- List models filtered by user provider preferences, [privacy
- settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and
- [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
- `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region
- routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
- summary: List models filtered by user provider preferences, privacy settings, and guardrails
- security:
- - bearer: []
- responses:
- '200':
- description: Returns a list of models filtered by user provider preferences
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ModelsListResponse'
- example:
- data:
- - id: openai/gpt-4
- canonical_slug: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- top_provider:
- context_length: 8192
- max_completion_tokens: 4096
- is_moderated: true
- per_request_limits: null
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/gpt-5.4/endpoints
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- operationId: listModelsUser
- /models/{author}/{slug}/endpoints:
- get:
- tags:
- - Endpoints
- operationId: listEndpoints
- x-speakeasy-name-override: list
- summary: List all endpoints for a model
- parameters:
- - schema:
- type: string
- description: The author/organization of the model
- example: openai
- required: true
- description: The author/organization of the model
- name: author
- in: path
- - schema:
- type: string
- description: The model slug
- example: gpt-4
- required: true
- description: The model slug
- name: slug
- in: path
- responses:
- '200':
- description: Returns a list of endpoints
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- $ref: '#/components/schemas/ListEndpointsResponse'
- required:
- - data
- example:
- data:
- id: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- endpoints:
- - name: 'OpenAI: GPT-4'
- model_id: openai/gpt-4
- model_name: GPT-4
- context_length: 8192
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- provider_name: OpenAI
- tag: openai
- quantization: fp16
- max_completion_tokens: 4096
- max_prompt_tokens: 8192
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- status: default
- uptime_last_30m: 99.5
- uptime_last_5m: 100
- uptime_last_1d: 99.8
- supports_implicit_caching: true
- latency_last_30m:
- p50: 0.25
- p75: 0.35
- p90: 0.48
- p99: 0.85
- throughput_last_30m:
- p50: 45.2
- p75: 38.5
- p90: 28.3
- p99: 15.1
- example:
- data:
- id: openai/gpt-4
- name: GPT-4
- created: 1692901234
- description: GPT-4 is a large multimodal model.
- architecture:
- tokenizer: GPT
- instruct_type: chatml
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - text
- endpoints: []
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /endpoints/zdr:
- get:
- tags:
- - Endpoints
- x-speakeasy-name-override: listZdrEndpoints
- summary: Preview the impact of ZDR on the available endpoints
- responses:
- '200':
- description: Returns a list of endpoints
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- $ref: '#/components/schemas/PublicEndpoint'
- required:
- - data
- example:
- data:
- - name: 'OpenAI: GPT-4'
- model_id: openai/gpt-4
- model_name: GPT-4
- context_length: 8192
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- provider_name: OpenAI
- tag: openai
- quantization: fp16
- max_completion_tokens: 4096
- max_prompt_tokens: 8192
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- status: default
- uptime_last_30m: 99.5
- uptime_last_5m: 100
- uptime_last_1d: 99.8
- supports_implicit_caching: true
- latency_last_30m:
- p50: 0.25
- p75: 0.35
- p90: 0.48
- p99: 0.85
- throughput_last_30m:
- p50: 45.2
- p75: 38.5
- p90: 28.3
- p99: 15.1
- example:
- data:
- - name: 'OpenAI: GPT-4'
- model_id: openai/gpt-4
- model_name: GPT-4
- context_length: 8192
- pricing:
- prompt: '0.00003'
- completion: '0.00006'
- request: '0'
- image: '0'
- provider_name: OpenAI
- tag: openai
- quantization: fp16
- max_completion_tokens: 4096
- max_prompt_tokens: 8192
- supported_parameters:
- - temperature
- - top_p
- - max_tokens
- status: default
- uptime_last_30m: 99.5
- uptime_last_5m: 100
- uptime_last_1d: 99.8
- supports_implicit_caching: true
- latency_last_30m:
- p50: 0.25
- p75: 0.35
- p90: 0.48
- p99: 0.85
- throughput_last_30m:
- p50: 45.2
- p75: 38.5
- p90: 28.3
- p99: 15.1
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- operationId: listEndpointsZdr
- /providers:
- get:
- tags:
- - Providers
- x-speakeasy-name-override: list
- summary: List all providers
- operationId: listProviders
- responses:
- '200':
- description: Returns a list of providers
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- type: object
- properties:
- name:
- type: string
- description: Display name of the provider
- example: OpenAI
- slug:
- type: string
- description: URL-friendly identifier for the provider
- example: openai
- privacy_policy_url:
- type: string
- nullable: true
- description: URL to the provider's privacy policy
- example: https://openai.com/privacy
- terms_of_service_url:
- type: string
- nullable: true
- description: URL to the provider's terms of service
- example: https://openai.com/terms
- status_page_url:
- type: string
- nullable: true
- description: URL to the provider's status page
- example: https://status.openai.com
- headquarters:
- type: string
- nullable: true
- enum:
- - AD
- - AE
- - AF
- - AG
- - AI
- - AL
- - AM
- - AO
- - AQ
- - AR
- - AS
- - AT
- - AU
- - AW
- - AX
- - AZ
- - BA
- - BB
- - BD
- - BE
- - BF
- - BG
- - BH
- - BI
- - BJ
- - BL
- - BM
- - BN
- - BO
- - BQ
- - BR
- - BS
- - BT
- - BV
- - BW
- - BY
- - BZ
- - CA
- - CC
- - CD
- - CF
- - CG
- - CH
- - CI
- - CK
- - CL
- - CM
- - CN
- - CO
- - CR
- - CU
- - CV
- - CW
- - CX
- - CY
- - CZ
- - DE
- - DJ
- - DK
- - DM
- - DO
- - DZ
- - EC
- - EE
- - EG
- - EH
- - ER
- - ES
- - ET
- - FI
- - FJ
- - FK
- - FM
- - FO
- - FR
- - GA
- - GB
- - GD
- - GE
- - GF
- - GG
- - GH
- - GI
- - GL
- - GM
- - GN
- - GP
- - GQ
- - GR
- - GS
- - GT
- - GU
- - GW
- - GY
- - HK
- - HM
- - HN
- - HR
- - HT
- - HU
- - ID
- - IE
- - IL
- - IM
- - IN
- - IO
- - IQ
- - IR
- - IS
- - IT
- - JE
- - JM
- - JO
- - JP
- - KE
- - KG
- - KH
- - KI
- - KM
- - KN
- - KP
- - KR
- - KW
- - KY
- - KZ
- - LA
- - LB
- - LC
- - LI
- - LK
- - LR
- - LS
- - LT
- - LU
- - LV
- - LY
- - MA
- - MC
- - MD
- - ME
- - MF
- - MG
- - MH
- - MK
- - ML
- - MM
- - MN
- - MO
- - MP
- - MQ
- - MR
- - MS
- - MT
- - MU
- - MV
- - MW
- - MX
- - MY
- - MZ
- - NA
- - NC
- - NE
- - NF
- - NG
- - NI
- - NL
- - 'NO'
- - NP
- - NR
- - NU
- - NZ
- - OM
- - PA
- - PE
- - PF
- - PG
- - PH
- - PK
- - PL
- - PM
- - PN
- - PR
- - PS
- - PT
- - PW
- - PY
- - QA
- - RE
- - RO
- - RS
- - RU
- - RW
- - SA
- - SB
- - SC
- - SD
- - SE
- - SG
- - SH
- - SI
- - SJ
- - SK
- - SL
- - SM
- - SN
- - SO
- - SR
- - SS
- - ST
- - SV
- - SX
- - SY
- - SZ
- - TC
- - TD
- - TF
- - TG
- - TH
- - TJ
- - TK
- - TL
- - TM
- - TN
- - TO
- - TR
- - TT
- - TV
- - TW
- - TZ
- - UA
- - UG
- - UM
- - US
- - UY
- - UZ
- - VA
- - VC
- - VE
- - VG
- - VI
- - VN
- - VU
- - WF
- - WS
- - YE
- - YT
- - ZA
- - ZM
- - ZW
- - null
- description: ISO 3166-1 Alpha-2 country code of the provider headquarters
- example: US
- datacenters:
- type: array
- nullable: true
- items:
- type: string
- enum:
- - AD
- - AE
- - AF
- - AG
- - AI
- - AL
- - AM
- - AO
- - AQ
- - AR
- - AS
- - AT
- - AU
- - AW
- - AX
- - AZ
- - BA
- - BB
- - BD
- - BE
- - BF
- - BG
- - BH
- - BI
- - BJ
- - BL
- - BM
- - BN
- - BO
- - BQ
- - BR
- - BS
- - BT
- - BV
- - BW
- - BY
- - BZ
- - CA
- - CC
- - CD
- - CF
- - CG
- - CH
- - CI
- - CK
- - CL
- - CM
- - CN
- - CO
- - CR
- - CU
- - CV
- - CW
- - CX
- - CY
- - CZ
- - DE
- - DJ
- - DK
- - DM
- - DO
- - DZ
- - EC
- - EE
- - EG
- - EH
- - ER
- - ES
- - ET
- - FI
- - FJ
- - FK
- - FM
- - FO
- - FR
- - GA
- - GB
- - GD
- - GE
- - GF
- - GG
- - GH
- - GI
- - GL
- - GM
- - GN
- - GP
- - GQ
- - GR
- - GS
- - GT
- - GU
- - GW
- - GY
- - HK
- - HM
- - HN
- - HR
- - HT
- - HU
- - ID
- - IE
- - IL
- - IM
- - IN
- - IO
- - IQ
- - IR
- - IS
- - IT
- - JE
- - JM
- - JO
- - JP
- - KE
- - KG
- - KH
- - KI
- - KM
- - KN
- - KP
- - KR
- - KW
- - KY
- - KZ
- - LA
- - LB
- - LC
- - LI
- - LK
- - LR
- - LS
- - LT
- - LU
- - LV
- - LY
- - MA
- - MC
- - MD
- - ME
- - MF
- - MG
- - MH
- - MK
- - ML
- - MM
- - MN
- - MO
- - MP
- - MQ
- - MR
- - MS
- - MT
- - MU
- - MV
- - MW
- - MX
- - MY
- - MZ
- - NA
- - NC
- - NE
- - NF
- - NG
- - NI
- - NL
- - 'NO'
- - NP
- - NR
- - NU
- - NZ
- - OM
- - PA
- - PE
- - PF
- - PG
- - PH
- - PK
- - PL
- - PM
- - PN
- - PR
- - PS
- - PT
- - PW
- - PY
- - QA
- - RE
- - RO
- - RS
- - RU
- - RW
- - SA
- - SB
- - SC
- - SD
- - SE
- - SG
- - SH
- - SI
- - SJ
- - SK
- - SL
- - SM
- - SN
- - SO
- - SR
- - SS
- - ST
- - SV
- - SX
- - SY
- - SZ
- - TC
- - TD
- - TF
- - TG
- - TH
- - TJ
- - TK
- - TL
- - TM
- - TN
- - TO
- - TR
- - TT
- - TV
- - TW
- - TZ
- - UA
- - UG
- - UM
- - US
- - UY
- - UZ
- - VA
- - VC
- - VE
- - VG
- - VI
- - VN
- - VU
- - WF
- - WS
- - YE
- - YT
- - ZA
- - ZM
- - ZW
- description: ISO 3166-1 Alpha-2 country codes of the provider datacenter locations
+ summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
+ type: reasoning.summary
+ oneOf:
+ - $ref: '#/components/schemas/ReasoningDetailSummary'
+ - $ref: '#/components/schemas/ReasoningDetailEncrypted'
+ - $ref: '#/components/schemas/ReasoningDetailText'
+ ReasoningDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningDoneEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when reasoning text streaming is complete
+ example:
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ sequence_number: 6
+ text: First, we need to identify the key components and then combine them logically.
+ type: response.reasoning_text.done
+ ReasoningEffort:
+ enum:
+ - xhigh
+ - high
+ - medium
+ - low
+ - minimal
+ - none
+ - null
+ example: medium
+ nullable: true
+ type: string
+ ReasoningFormat:
+ enum:
+ - unknown
+ - openai-responses-v1
+ - azure-openai-responses-v1
+ - xai-responses-v1
+ - anthropic-claude-v1
+ - google-gemini-v1
+ - null
+ example: unknown
+ nullable: true
+ type: string
+ ReasoningItem:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemReasoning'
+ - properties:
+ content:
+ items:
+ $ref: '#/components/schemas/ReasoningTextContent'
+ nullable: true
+ type: array
+ format:
+ $ref: '#/components/schemas/ReasoningFormat'
+ signature:
+ nullable: true
+ type: string
+ type: object
+ description: Reasoning output item with signature and format extensions
+ example:
+ id: reasoning-abc123
+ summary:
+ - text: Step by step analysis
+ type: summary_text
+ type: reasoning
+ ReasoningSummaryPartAddedEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningSummaryPartAddedEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when a reasoning summary part is added
+ example:
+ item_id: item-1
+ output_index: 0
+ part:
+ text: ''
+ type: summary_text
+ sequence_number: 3
+ summary_index: 0
+ type: response.reasoning_summary_part.added
+ ReasoningSummaryPartDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningSummaryPartDoneEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when a reasoning summary part is complete
+ example:
+ item_id: item-1
+ output_index: 0
+ part:
+ text: Analyzing the problem step by step to find the optimal solution.
+ type: summary_text
+ sequence_number: 7
+ summary_index: 0
+ type: response.reasoning_summary_part.done
+ ReasoningSummaryText:
+ example:
+ text: Analyzed the problem using first principles
+ type: summary_text
+ properties:
+ text:
+ type: string
+ type:
+ enum:
+ - summary_text
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ ReasoningSummaryTextDeltaEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningSummaryTextDeltaEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when reasoning summary text delta is streamed
+ example:
+ delta: Analyzing
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ summary_index: 0
+ type: response.reasoning_summary_text.delta
+ ReasoningSummaryTextDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseReasoningSummaryTextDoneEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when reasoning summary text streaming is complete
+ example:
+ item_id: item-1
+ output_index: 0
+ sequence_number: 6
+ summary_index: 0
+ text: Analyzing the problem step by step to find the optimal solution.
+ type: response.reasoning_summary_text.done
+ ReasoningSummaryVerbosity:
+ enum:
+ - auto
+ - concise
+ - detailed
+ - null
+ example: auto
+ nullable: true
+ type: string
+ ReasoningTextContent:
+ example:
+ text: Let me think step by step about this problem...
+ type: reasoning_text
+ properties:
+ text:
+ type: string
+ type:
+ enum:
+ - reasoning_text
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ RefusalDeltaEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseRefusalDeltaEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when a refusal delta is streamed
+ example:
+ content_index: 0
+ delta: I'm sorry
+ item_id: item-1
+ output_index: 0
+ sequence_number: 4
+ type: response.refusal.delta
+ RefusalDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseRefusalDoneEvent'
+ - properties: {}
+ type: object
+ description: Event emitted when refusal streaming is complete
+ example:
+ content_index: 0
+ item_id: item-1
+ output_index: 0
+ refusal: I'm sorry, but I can't assist with that request.
+ sequence_number: 6
+ type: response.refusal.done
+ RequestMetadata:
+ additionalProperties:
+ maxLength: 512
+ type: string
+ description: >-
+ Metadata key-value pairs for the request. Keys must be ≤64 characters and cannot contain brackets. Values must
+ be ≤512 characters. Maximum 16 pairs allowed.
+ example:
+ session_id: abc-def-ghi
+ user_id: '123'
+ nullable: true
+ type: object
+ RequestTimeoutResponse:
+ description: Request Timeout - Operation exceeded time limit
+ example:
+ error:
+ code: 408
+ message: Operation timed out. Please try again later.
+ properties:
+ error:
+ $ref: '#/components/schemas/RequestTimeoutResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ RequestTimeoutResponseErrorData:
+ description: Error data for RequestTimeoutResponse
+ example:
+ code: 408
+ message: Operation timed out. Please try again later.
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ ResponseHealingPlugin:
+ example:
+ enabled: true
+ id: response-healing
+ properties:
+ enabled:
+ description: Set to false to disable the response-healing plugin for this request. Defaults to true.
+ type: boolean
+ id:
+ enum:
+ - response-healing
+ type: string
+ required:
+ - id
+ type: object
+ ResponseIncludesEnum:
+ enum:
+ - file_search_call.results
+ - message.input_image.image_url
+ - computer_call_output.output.image_url
+ - reasoning.encrypted_content
+ - code_interpreter_call.outputs
+ example: file_search_call.results
+ type: string
+ ResponseOutputText:
+ example:
+ annotations:
+ - end_index: 42
+ start_index: 0
+ title: Paris - Wikipedia
+ type: url_citation
+ url: https://en.wikipedia.org/wiki/Paris
+ text: The capital of France is Paris.
+ type: output_text
+ properties:
+ annotations:
+ items:
+ $ref: '#/components/schemas/OpenAIResponsesAnnotation'
+ type: array
+ logprobs:
+ items:
+ properties:
+ bytes:
+ items:
+ type: integer
+ type: array
+ logprob:
+ format: double
+ type: number
+ token:
+ type: string
+ top_logprobs:
+ items:
+ properties:
+ bytes:
+ items:
+ type: integer
+ type: array
+ logprob:
+ format: double
+ type: number
+ token:
+ type: string
+ required:
+ - token
+ - bytes
+ - logprob
+ type: object
+ type: array
+ required:
+ - token
+ - bytes
+ - logprob
+ - top_logprobs
+ type: object
+ type: array
+ text:
+ type: string
+ type:
+ enum:
+ - output_text
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ ResponsesErrorField:
+ description: Error information returned from the API
+ example:
+ code: rate_limit_exceeded
+ message: Rate limit exceeded. Please try again later.
+ nullable: true
+ properties:
+ code:
+ enum:
+ - server_error
+ - rate_limit_exceeded
+ - invalid_prompt
+ - vector_store_timeout
+ - invalid_image
+ - invalid_image_format
+ - invalid_base64_image
+ - invalid_image_url
+ - image_too_large
+ - image_too_small
+ - image_parse_error
+ - image_content_policy_violation
+ - invalid_image_mode
+ - image_file_too_large
+ - unsupported_image_media_type
+ - empty_image_file
+ - failed_to_download_image
+ - image_file_not_found
+ type: string
+ message:
+ type: string
+ required:
+ - code
+ - message
+ type: object
+ ResponsesRequest:
+ description: Request schema for Responses endpoint
+ example:
+ input:
+ - content: Hello, how are you?
+ role: user
+ type: message
+ model: anthropic/claude-4.5-sonnet-20250929
+ temperature: 0.7
+ tools:
+ - description: Get the current weather in a given location
+ name: get_current_weather
+ parameters:
+ properties:
+ location:
+ type: string
+ type: object
+ type: function
+ top_p: 0.9
+ properties:
+ background:
+ nullable: true
+ type: boolean
+ frequency_penalty:
+ format: double
+ type: number
+ image_config:
+ additionalProperties:
+ anyOf:
+ - type: string
+ - format: double
+ type: number
+ description: >-
+ Provider-specific image configuration options. Keys and values vary by model/provider. See
+ https://openrouter.ai/docs/features/multimodal/image-generation for more details.
+ example:
+ aspect_ratio: '16:9'
+ type: object
+ include:
+ items:
+ $ref: '#/components/schemas/ResponseIncludesEnum'
+ nullable: true
+ type: array
+ input:
+ $ref: '#/components/schemas/Inputs'
+ instructions:
+ nullable: true
+ type: string
+ max_output_tokens:
+ type: integer
+ max_tool_calls:
+ type: integer
+ metadata:
+ $ref: '#/components/schemas/RequestMetadata'
+ modalities:
+ description: Output modalities for the response. Supported values are "text" and "image".
+ example:
+ - text
+ - image
+ items:
+ $ref: '#/components/schemas/OutputModalityEnum'
+ type: array
+ model:
+ type: string
+ models:
+ items:
+ type: string
+ type: array
+ parallel_tool_calls:
+ nullable: true
+ type: boolean
+ plugins:
+ description: Plugins you want to enable for this request, including their settings.
+ items:
+ discriminator:
+ mapping:
+ auto-router: '#/components/schemas/AutoRouterPlugin'
+ context-compression: '#/components/schemas/ContextCompressionPlugin'
+ file-parser: '#/components/schemas/FileParserPlugin'
+ moderation: '#/components/schemas/ModerationPlugin'
+ response-healing: '#/components/schemas/ResponseHealingPlugin'
+ web: '#/components/schemas/WebSearchPlugin'
+ propertyName: id
+ oneOf:
+ - $ref: '#/components/schemas/AutoRouterPlugin'
+ - $ref: '#/components/schemas/ModerationPlugin'
+ - $ref: '#/components/schemas/WebSearchPlugin'
+ - $ref: '#/components/schemas/FileParserPlugin'
+ - $ref: '#/components/schemas/ResponseHealingPlugin'
+ - $ref: '#/components/schemas/ContextCompressionPlugin'
+ type: array
+ presence_penalty:
+ format: double
+ type: number
+ previous_response_id:
+ nullable: true
+ type: string
+ prompt:
+ $ref: '#/components/schemas/StoredPromptTemplate'
+ prompt_cache_key:
+ nullable: true
+ type: string
+ provider:
+ $ref: '#/components/schemas/ProviderPreferences'
+ reasoning:
+ $ref: '#/components/schemas/ReasoningConfig'
+ route:
+ $ref: '#/components/schemas/DeprecatedRoute'
+ safety_identifier:
+ nullable: true
+ type: string
+ service_tier:
+ default: auto
+ enum:
+ - auto
+ - default
+ - flex
+ - priority
+ - scale
+ - null
+ nullable: true
+ type: string
+ session_id:
+ description: >-
+ A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for
+ observability. If provided in both the request body and the x-session-id header, the body value takes
+ precedence. Maximum of 256 characters.
+ maxLength: 256
+ type: string
+ store:
+ const: false
+ default: false
+ type: boolean
+ stream:
+ default: false
+ type: boolean
+ temperature:
+ format: double
+ type: number
+ text:
+ $ref: '#/components/schemas/TextExtendedConfig'
+ tool_choice:
+ $ref: '#/components/schemas/OpenAIResponsesToolChoice'
+ tools:
+ items:
+ anyOf:
+ - allOf:
+ - $ref: '#/components/schemas/FunctionTool'
+ - properties: {}
+ type: object
+ description: Function tool definition
+ example:
+ description: Get the current weather in a location
+ name: get_weather
+ parameters:
+ properties:
+ location:
+ description: The city and state
+ type: string
+ unit:
+ enum:
+ - celsius
+ - fahrenheit
+ type: string
+ required:
+ - location
+ type: object
+ type: function
+ - $ref: '#/components/schemas/Preview_WebSearchServerTool'
+ - $ref: '#/components/schemas/Preview_20250311_WebSearchServerTool'
+ - $ref: '#/components/schemas/Legacy_WebSearchServerTool'
+ - $ref: '#/components/schemas/WebSearchServerTool'
+ - $ref: '#/components/schemas/FileSearchServerTool'
+ - $ref: '#/components/schemas/ComputerUseServerTool'
+ - $ref: '#/components/schemas/CodeInterpreterServerTool'
+ - $ref: '#/components/schemas/McpServerTool'
+ - $ref: '#/components/schemas/ImageGenerationServerTool'
+ - $ref: '#/components/schemas/CodexLocalShellTool'
+ - $ref: '#/components/schemas/ShellServerTool'
+ - $ref: '#/components/schemas/ApplyPatchServerTool'
+ - $ref: '#/components/schemas/CustomTool'
+ - $ref: '#/components/schemas/DatetimeServerTool'
+ - $ref: '#/components/schemas/WebSearchServerTool_OpenRouter'
+ type: array
+ top_k:
+ type: integer
+ top_logprobs:
+ type: integer
+ top_p:
+ format: double
+ type: number
+ trace:
+ $ref: '#/components/schemas/TraceConfig'
+ truncation:
+ $ref: '#/components/schemas/OpenAIResponsesTruncation'
+ user:
+ description: >-
+ A unique identifier representing your end-user, which helps distinguish between different users of your app.
+ This allows your app to identify specific users in case of abuse reports, preventing your entire app from
+ being affected by the actions of individual users. Maximum of 256 characters.
+ maxLength: 256
+ type: string
+ type: object
+ SearchContextSizeEnum:
+ description: Size of the search context for web search tools
+ enum:
+ - low
+ - medium
+ - high
+ example: medium
+ type: string
+ SearchQualityLevel:
+ description: >-
+ How much context to retrieve per result. Defaults to medium (15000 chars). Only applies when using the Exa
+ engine; ignored with native provider search.
+ enum:
+ - low
+ - medium
+ - high
+ example: medium
+ type: string
+ ServiceTier:
+ enum:
+ - auto
+ - default
+ - flex
+ - priority
+ - scale
+ - null
+ example: default
+ nullable: true
+ type: string
+ ServiceUnavailableResponse:
+ description: Service Unavailable - Service temporarily unavailable
+ example:
+ error:
+ code: 503
+ message: Service temporarily unavailable
+ properties:
+ error:
+ $ref: '#/components/schemas/ServiceUnavailableResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ ServiceUnavailableResponseErrorData:
+ description: Error data for ServiceUnavailableResponse
+ example:
+ code: 503
+ message: Service temporarily unavailable
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ ShellServerTool:
+ description: Shell tool configuration
+ example:
+ type: shell
+ properties:
+ type:
+ enum:
+ - shell
+ type: string
+ required:
+ - type
+ type: object
+ StoredPromptTemplate:
+ example:
+ id: prompt-abc123
+ variables:
+ name: John
+ nullable: true
+ properties:
+ id:
+ type: string
+ variables:
+ additionalProperties:
+ anyOf:
+ - type: string
+ - $ref: '#/components/schemas/InputText'
+ - $ref: '#/components/schemas/InputImage'
+ - $ref: '#/components/schemas/InputFile'
+ nullable: true
+ type: object
+ required:
+ - id
+ type: object
+ StreamEvents:
+ description: Union of all possible event types emitted during response streaming
+ discriminator:
+ mapping:
+ error: '#/components/schemas/ErrorEvent'
+ response.completed: '#/components/schemas/StreamEventsResponseCompleted'
+ response.content_part.added: '#/components/schemas/ContentPartAddedEvent'
+ response.content_part.done: '#/components/schemas/ContentPartDoneEvent'
+ response.created: '#/components/schemas/OpenResponsesCreatedEvent'
+ response.failed: '#/components/schemas/StreamEventsResponseFailed'
+ response.function_call_arguments.delta: '#/components/schemas/FunctionCallArgsDeltaEvent'
+ response.function_call_arguments.done: '#/components/schemas/FunctionCallArgsDoneEvent'
+ response.image_generation_call.completed: '#/components/schemas/ImageGenCallCompletedEvent'
+ response.image_generation_call.generating: '#/components/schemas/ImageGenCallGeneratingEvent'
+ response.image_generation_call.in_progress: '#/components/schemas/ImageGenCallInProgressEvent'
+ response.image_generation_call.partial_image: '#/components/schemas/ImageGenCallPartialImageEvent'
+ response.in_progress: '#/components/schemas/OpenResponsesInProgressEvent'
+ response.incomplete: '#/components/schemas/StreamEventsResponseIncomplete'
+ response.output_item.added: '#/components/schemas/StreamEventsResponseOutputItemAdded'
+ response.output_item.done: '#/components/schemas/StreamEventsResponseOutputItemDone'
+ response.output_text.annotation.added: '#/components/schemas/AnnotationAddedEvent'
+ response.output_text.delta: '#/components/schemas/TextDeltaEvent'
+ response.output_text.done: '#/components/schemas/TextDoneEvent'
+ response.reasoning_summary_part.added: '#/components/schemas/ReasoningSummaryPartAddedEvent'
+ response.reasoning_summary_part.done: '#/components/schemas/ReasoningSummaryPartDoneEvent'
+ response.reasoning_summary_text.delta: '#/components/schemas/ReasoningSummaryTextDeltaEvent'
+ response.reasoning_summary_text.done: '#/components/schemas/ReasoningSummaryTextDoneEvent'
+ response.reasoning_text.delta: '#/components/schemas/ReasoningDeltaEvent'
+ response.reasoning_text.done: '#/components/schemas/ReasoningDoneEvent'
+ response.refusal.delta: '#/components/schemas/RefusalDeltaEvent'
+ response.refusal.done: '#/components/schemas/RefusalDoneEvent'
+ response.web_search_call.completed: '#/components/schemas/WebSearchCallCompletedEvent'
+ response.web_search_call.in_progress: '#/components/schemas/WebSearchCallInProgressEvent'
+ response.web_search_call.searching: '#/components/schemas/WebSearchCallSearchingEvent'
+ propertyName: type
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: in_progress
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 0
+ type: response.created
+ oneOf:
+ - $ref: '#/components/schemas/OpenResponsesCreatedEvent'
+ - $ref: '#/components/schemas/OpenResponsesInProgressEvent'
+ - $ref: '#/components/schemas/StreamEventsResponseCompleted'
+ - $ref: '#/components/schemas/StreamEventsResponseIncomplete'
+ - $ref: '#/components/schemas/StreamEventsResponseFailed'
+ - $ref: '#/components/schemas/ErrorEvent'
+ - $ref: '#/components/schemas/StreamEventsResponseOutputItemAdded'
+ - $ref: '#/components/schemas/StreamEventsResponseOutputItemDone'
+ - $ref: '#/components/schemas/ContentPartAddedEvent'
+ - $ref: '#/components/schemas/ContentPartDoneEvent'
+ - $ref: '#/components/schemas/TextDeltaEvent'
+ - $ref: '#/components/schemas/TextDoneEvent'
+ - $ref: '#/components/schemas/RefusalDeltaEvent'
+ - $ref: '#/components/schemas/RefusalDoneEvent'
+ - $ref: '#/components/schemas/AnnotationAddedEvent'
+ - $ref: '#/components/schemas/FunctionCallArgsDeltaEvent'
+ - $ref: '#/components/schemas/FunctionCallArgsDoneEvent'
+ - $ref: '#/components/schemas/ReasoningDeltaEvent'
+ - $ref: '#/components/schemas/ReasoningDoneEvent'
+ - $ref: '#/components/schemas/ReasoningSummaryPartAddedEvent'
+ - $ref: '#/components/schemas/ReasoningSummaryPartDoneEvent'
+ - $ref: '#/components/schemas/ReasoningSummaryTextDeltaEvent'
+ - $ref: '#/components/schemas/ReasoningSummaryTextDoneEvent'
+ - $ref: '#/components/schemas/ImageGenCallInProgressEvent'
+ - $ref: '#/components/schemas/ImageGenCallGeneratingEvent'
+ - $ref: '#/components/schemas/ImageGenCallPartialImageEvent'
+ - $ref: '#/components/schemas/ImageGenCallCompletedEvent'
+ - $ref: '#/components/schemas/WebSearchCallInProgressEvent'
+ - $ref: '#/components/schemas/WebSearchCallSearchingEvent'
+ - $ref: '#/components/schemas/WebSearchCallCompletedEvent'
+ StreamEventsResponseCompleted:
+ allOf:
+ - $ref: '#/components/schemas/CompletedEvent'
+ - properties:
+ response:
+ $ref: '#/components/schemas/OpenResponsesResult'
+ type: object
+ description: Event emitted when a response has completed successfully
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: completed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 10
+ type: response.completed
+ StreamEventsResponseFailed:
+ allOf:
+ - $ref: '#/components/schemas/FailedEvent'
+ - properties:
+ response:
+ $ref: '#/components/schemas/OpenResponsesResult'
+ type: object
+ description: Event emitted when a response has failed
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: failed
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 3
+ type: response.failed
+ StreamEventsResponseIncomplete:
+ allOf:
+ - $ref: '#/components/schemas/IncompleteEvent'
+ - properties:
+ response:
+ $ref: '#/components/schemas/OpenResponsesResult'
+ type: object
+ description: Event emitted when a response is incomplete
+ example:
+ response:
+ created_at: 1704067200
+ error: null
+ id: resp-abc123
+ incomplete_details: null
+ instructions: null
+ max_output_tokens: null
+ metadata: null
+ model: gpt-4
+ object: response
+ output: []
+ parallel_tool_calls: true
+ status: incomplete
+ temperature: null
+ tool_choice: auto
+ tools: []
+ top_p: null
+ sequence_number: 5
+ type: response.incomplete
+ StreamEventsResponseOutputItemAdded:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemAddedEvent'
+ - properties:
+ item:
+ $ref: '#/components/schemas/OutputItems'
+ type: object
+ description: Event emitted when a new output item is added to the response
+ example:
+ item:
+ content: []
+ id: item-1
+ role: assistant
+ status: in_progress
+ type: message
+ output_index: 0
+ sequence_number: 2
+ type: response.output_item.added
+ StreamEventsResponseOutputItemDone:
+ allOf:
+ - $ref: '#/components/schemas/OutputItemDoneEvent'
+ - properties:
+ item:
+ $ref: '#/components/schemas/OutputItems'
+ type: object
+ description: Event emitted when an output item is complete
+ example:
+ item:
+ content:
+ - annotations: []
+ text: Hello! How can I help you?
+ type: output_text
+ id: item-1
+ role: assistant
+ status: completed
+ type: message
+ output_index: 0
+ sequence_number: 8
+ type: response.output_item.done
+ StreamLogprob:
+ allOf:
+ - $ref: '#/components/schemas/OpenResponsesLogProbs'
+ - properties:
+ top_logprobs:
+ items:
+ $ref: '#/components/schemas/StreamLogprobTopLogprob'
+ type: array
+ type: object
+ description: Log probability information for a token
+ example:
+ bytes:
+ - 72
+ - 101
+ - 108
+ - 108
+ - 111
+ logprob: -0.5
+ token: Hello
+ top_logprobs: []
+ StreamLogprobTopLogprob:
+ allOf:
+ - $ref: '#/components/schemas/OpenResponsesTopLogprobs'
+ - properties: {}
+ type: object
+ description: Alternative token with its log probability
+ example:
+ bytes:
+ - 72
+ - 101
+ - 108
+ - 108
+ - 111
+ logprob: -0.5
+ token: Hello
+ TextConfig:
+ description: Text output configuration including format and verbosity
+ example:
+ format:
+ type: text
+ verbosity: medium
+ properties:
+ format:
+ $ref: '#/components/schemas/Formats'
+ verbosity:
+ enum:
+ - high
+ - low
+ - medium
+ - null
+ nullable: true
+ type: string
+ type: object
+ TextDeltaEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseTextDeltaEvent'
+ - properties:
+ logprobs:
+ items:
+ $ref: '#/components/schemas/StreamLogprob'
+ type: array
+ type: object
+ description: Event emitted when a text delta is streamed
+ example:
+ content_index: 0
+ delta: Hello
+ item_id: item-1
+ logprobs: []
+ output_index: 0
+ sequence_number: 4
+ type: response.output_text.delta
+ TextDoneEvent:
+ allOf:
+ - $ref: '#/components/schemas/BaseTextDoneEvent'
+ - properties:
+ logprobs:
+ items:
+ $ref: '#/components/schemas/StreamLogprob'
+ type: array
+ type: object
+ description: Event emitted when text streaming is complete
+ example:
+ content_index: 0
+ item_id: item-1
+ logprobs: []
+ output_index: 0
+ sequence_number: 6
+ text: Hello! How can I help you?
+ type: response.output_text.done
+ TextExtendedConfig:
+ allOf:
+ - $ref: '#/components/schemas/TextConfig'
+ - properties: {}
+ type: object
+ description: Text output configuration including format and verbosity
+ example:
+ format:
+ type: text
+ ToolCallStatus:
+ enum:
+ - in_progress
+ - completed
+ - incomplete
+ example: completed
+ type: string
+ ToolChoiceAllowed:
+ description: Constrains the model to a pre-defined set of allowed tools
+ example:
+ mode: auto
+ tools:
+ - name: get_weather
+ type: function
+ type: allowed_tools
+ properties:
+ mode:
+ anyOf:
+ - enum:
+ - auto
+ type: string
+ - enum:
+ - required
+ type: string
+ tools:
+ items:
+ additionalProperties:
+ nullable: true
+ type: object
+ type: array
+ type:
+ enum:
+ - allowed_tools
+ type: string
+ required:
+ - type
+ - mode
+ - tools
+ type: object
+ TooManyRequestsResponse:
+ description: Too Many Requests - Rate limit exceeded
+ example:
+ error:
+ code: 429
+ message: Rate limit exceeded
+ properties:
+ error:
+ $ref: '#/components/schemas/TooManyRequestsResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ TooManyRequestsResponseErrorData:
+ description: Error data for TooManyRequestsResponse
+ example:
+ code: 429
+ message: Rate limit exceeded
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ TopProviderInfo:
+ description: Information about the top provider for this model
+ example:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
+ properties:
+ context_length:
+ description: Context length from the top provider
+ example: 8192
+ type: integer
+ is_moderated:
+ description: Whether the top provider moderates content
+ example: true
+ type: boolean
+ max_completion_tokens:
+ description: Maximum completion tokens from the top provider
+ example: 4096
+ type: integer
+ required:
+ - is_moderated
+ type: object
+ TraceConfig:
+ additionalProperties:
+ nullable: true
+ description: >-
+ Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name,
+ parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured
+ broadcast destinations.
+ example:
+ trace_id: trace-abc123
+ trace_name: my-app-trace
+ properties:
+ generation_name:
+ type: string
+ parent_span_id:
+ type: string
+ span_name:
+ type: string
+ trace_id:
+ type: string
+ trace_name:
+ type: string
+ type: object
+ Truncation:
+ enum:
+ - auto
+ - disabled
+ - null
+ example: auto
+ nullable: true
+ type: string
+ UnauthorizedResponse:
+ description: Unauthorized - Authentication required or invalid credentials
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ properties:
+ error:
+ $ref: '#/components/schemas/UnauthorizedResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ UnauthorizedResponseErrorData:
+ description: Error data for UnauthorizedResponse
+ example:
+ code: 401
+ message: Missing Authentication header
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ UnprocessableEntityResponse:
+ description: Unprocessable Entity - Semantic validation failure
+ example:
+ error:
+ code: 422
+ message: Invalid argument
+ properties:
+ error:
+ $ref: '#/components/schemas/UnprocessableEntityResponseErrorData'
+ user_id:
+ nullable: true
+ type: string
+ required:
+ - error
+ type: object
+ UnprocessableEntityResponseErrorData:
+ description: Error data for UnprocessableEntityResponse
+ example:
+ code: 422
+ message: Invalid argument
+ properties:
+ code:
+ type: integer
+ message:
+ type: string
+ metadata:
+ additionalProperties:
+ nullable: true
+ nullable: true
+ type: object
+ required:
+ - code
+ - message
+ type: object
+ UpdateGuardrailRequest:
+ example:
+ description: Updated description
+ limit_usd: 75
+ name: Updated Guardrail Name
+ reset_interval: weekly
+ properties:
+ allowed_models:
+ description: Array of model identifiers (slug or canonical_slug accepted)
+ example:
+ - openai/gpt-5.2
+ items:
+ type: string
+ minItems: 1
+ nullable: true
+ type: array
+ allowed_providers:
+ description: New list of allowed provider IDs
+ example:
+ - openai
+ - anthropic
+ - deepseek
+ items:
+ type: string
+ minItems: 1
+ nullable: true
+ type: array
+ description:
+ description: New description for the guardrail
+ example: Updated description
+ maxLength: 1000
+ nullable: true
+ type: string
+ enforce_zdr:
+ description: Whether to enforce zero data retention
+ example: true
+ nullable: true
+ type: boolean
+ ignored_providers:
+ description: List of provider IDs to exclude from routing
+ example:
+ - azure
+ items:
+ type: string
+ minItems: 1
+ nullable: true
+ type: array
+ limit_usd:
+ description: New spending limit in USD
+ example: 75
+ format: double
+ type: number
+ name:
+ description: New name for the guardrail
+ example: Updated Guardrail Name
+ maxLength: 200
+ minLength: 1
+ type: string
+ reset_interval:
+ $ref: '#/components/schemas/GuardrailInterval'
+ type: object
+ UpdateGuardrailResponse:
+ example:
+ data:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ created_at: '2025-08-24T10:30:00Z'
+ description: Updated description
+ enforce_zdr: true
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 75
+ name: Updated Guardrail Name
+ reset_interval: weekly
+ updated_at: '2025-08-24T16:00:00Z'
+ properties:
+ data:
+ allOf:
+ - $ref: '#/components/schemas/Guardrail'
+ - description: The updated guardrail
+ required:
+ - data
+ type: object
+ URLCitation:
+ example:
+ end_index: 42
+ start_index: 0
+ title: OpenRouter Documentation
+ type: url_citation
+ url: https://openrouter.ai/docs
+ properties:
+ end_index:
+ type: integer
+ start_index:
+ type: integer
+ title:
+ type: string
+ type:
+ enum:
+ - url_citation
+ type: string
+ url:
+ type: string
+ required:
+ - type
+ - url
+ - title
+ - start_index
+ - end_index
+ type: object
+ Usage:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesUsage'
+ - nullable: true
+ properties:
+ cost:
+ description: Cost of the completion
+ format: double
+ type: number
+ cost_details:
+ properties:
+ upstream_inference_cost:
+ format: double
+ type: number
+ upstream_inference_input_cost:
+ format: double
+ type: number
+ upstream_inference_output_cost:
+ format: double
+ type: number
+ required:
+ - upstream_inference_input_cost
+ - upstream_inference_output_cost
+ type: object
+ is_byok:
+ description: Whether a request was made using a Bring Your Own Key configuration
+ type: boolean
+ type: object
+ description: Token usage information for the response
+ example:
+ cost: 0.0012
+ cost_details:
+ upstream_inference_cost: null
+ upstream_inference_input_cost: 0.0008
+ upstream_inference_output_cost: 0.0004
+ input_tokens: 10
+ input_tokens_details:
+ cached_tokens: 0
+ output_tokens: 25
+ output_tokens_details:
+ reasoning_tokens: 0
+ total_tokens: 35
+ WebSearchCallCompletedEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
+ - properties: {}
+ type: object
+ description: Web search call completed
+ example:
+ item_id: ws-123
+ output_index: 0
+ sequence_number: 3
+ type: response.web_search_call.completed
+ WebSearchCallInProgressEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
+ - properties: {}
+ type: object
+ description: Web search call in progress
+ example:
+ item_id: ws-123
+ output_index: 0
+ sequence_number: 1
+ type: response.web_search_call.in_progress
+ WebSearchCallSearchingEvent:
+ allOf:
+ - $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
+ - properties: {}
+ type: object
+ description: Web search call is searching
+ example:
+ item_id: ws-123
+ output_index: 0
+ sequence_number: 2
+ type: response.web_search_call.searching
+ WebSearchConfig:
+ example:
+ max_results: 5
+ search_context_size: medium
+ properties:
+ allowed_domains:
+ description: >-
+ Limit search results to these domains. Supported by Exa, Parallel, and most native providers (Anthropic,
+ OpenAI, xAI). Not supported with Firecrawl or Perplexity.
+ items:
+ type: string
+ type: array
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ excluded_domains:
+ description: >-
+ Exclude search results from these domains. Supported by Exa, Parallel, Anthropic, and xAI. Not supported
+ with Firecrawl, OpenAI (silently ignored), or Perplexity.
+ items:
+ type: string
+ type: array
+ max_results:
+ description: >-
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
+ type: integer
+ max_total_results:
+ description: >-
+ Maximum total number of search results across all search calls in a single request. Once this limit is
+ reached, the tool will stop returning new results. Useful for controlling cost and context size in agentic
+ loops.
+ example: 20
+ type: integer
+ search_context_size:
+ $ref: '#/components/schemas/SearchQualityLevel'
+ user_location:
+ $ref: '#/components/schemas/WebSearchUserLocationServerTool'
+ type: object
+ WebSearchDomainFilter:
+ example:
+ allowed_domains:
+ - example.com
+ excluded_domains:
+ - spam.com
+ nullable: true
+ properties:
+ allowed_domains:
+ items:
+ type: string
+ nullable: true
+ type: array
+ excluded_domains:
+ items:
+ type: string
+ nullable: true
+ type: array
+ type: object
+ WebSearchEngine:
+ description: The search engine to use for web search.
+ enum:
+ - native
+ - exa
+ - firecrawl
+ - parallel
+ example: exa
+ type: string
+ WebSearchEngineEnum:
+ description: >-
+ Which search engine to use. "auto" (default) uses native if the provider supports it, otherwise Exa. "native"
+ forces the provider's built-in search. "exa" forces the Exa search API. "firecrawl" uses Firecrawl (requires
+ BYOK). "parallel" uses the Parallel search API.
+ enum:
+ - auto
+ - native
+ - exa
+ - firecrawl
+ - parallel
+ example: auto
+ type: string
+ WebSearchPlugin:
+ example:
+ enabled: true
+ id: web
+ max_results: 5
+ properties:
+ enabled:
+ description: Set to false to disable the web-search plugin for this request. Defaults to true.
+ type: boolean
+ engine:
+ $ref: '#/components/schemas/WebSearchEngine'
+ exclude_domains:
+ description: >-
+ A list of domains to exclude from web search results. Supports wildcards (e.g. "*.substack.com") and path
+ filtering (e.g. "openai.com/blog").
+ example:
+ - example.com
+ - '*.substack.com'
+ - openai.com/blog
+ items:
+ type: string
+ type: array
+ id:
+ enum:
+ - web
+ type: string
+ include_domains:
+ description: >-
+ A list of domains to restrict web search results to. Supports wildcards (e.g. "*.substack.com") and path
+ filtering (e.g. "openai.com/blog").
+ example:
+ - example.com
+ - '*.substack.com'
+ - openai.com/blog
+ items:
+ type: string
+ type: array
+ max_results:
+ type: integer
+ search_prompt:
+ type: string
+ required:
+ - id
+ type: object
+ WebSearchServerTool:
+ description: Web search tool configuration (2025-08-26 version)
+ example:
+ engine: auto
+ filters:
+ allowed_domains:
+ - example.com
+ type: web_search_2025_08_26
+ properties:
+ engine:
+ $ref: '#/components/schemas/WebSearchEngineEnum'
+ filters:
+ $ref: '#/components/schemas/WebSearchDomainFilter'
+ max_results:
+ description: >-
+ Maximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and
+ Parallel engines; ignored with native provider search.
+ example: 5
+ type: integer
+ search_context_size:
+ $ref: '#/components/schemas/SearchContextSizeEnum'
+ type:
+ enum:
+ - web_search_2025_08_26
+ type: string
+ user_location:
+ $ref: '#/components/schemas/WebSearchUserLocation'
+ required:
+ - type
+ type: object
+ WebSearchServerTool_OpenRouter:
+ description: 'OpenRouter built-in server tool: searches the web for current information'
+ example:
+ parameters:
+ max_results: 5
+ type: openrouter:web_search
+ properties:
+ parameters:
+ properties:
+ max_results:
+ description: Maximum number of search results to return per search call. Defaults to 5.
+ example: 5
+ type: integer
+ max_total_results:
+ description: >-
+ Maximum total number of search results across all search calls in a single request. Once this limit is
+ reached, the tool will stop returning new results.
+ example: 20
+ type: integer
+ type: object
+ type:
+ enum:
+ - openrouter:web_search
+ type: string
+ required:
+ - type
+ type: object
+ WebSearchSource:
+ example:
+ type: url
+ url: https://example.com/article
+ properties:
+ type:
+ enum:
+ - url
+ type: string
+ url:
+ type: string
+ required:
+ - type
+ - url
+ type: object
+ WebSearchStatus:
+ enum:
+ - completed
+ - searching
+ - in_progress
+ - failed
+ example: completed
+ type: string
+ WebSearchUserLocation:
+ description: User location information for web search
+ example:
+ city: San Francisco
+ country: USA
+ region: California
+ timezone: America/Los_Angeles
+ type: approximate
+ nullable: true
+ properties:
+ city:
+ nullable: true
+ type: string
+ country:
+ nullable: true
+ type: string
+ region:
+ nullable: true
+ type: string
+ timezone:
+ nullable: true
+ type: string
+ type:
+ enum:
+ - approximate
+ type: string
+ type: object
+ WebSearchUserLocationServerTool:
+ description: Approximate user location for location-biased results.
+ example:
+ city: San Francisco
+ country: US
+ region: California
+ timezone: America/Los_Angeles
+ type: approximate
+ properties:
+ city:
+ type: string
+ country:
+ type: string
+ region:
+ type: string
+ timezone:
+ type: string
+ type:
+ enum:
+ - approximate
+ type: string
+ type: object
+ securitySchemes:
+ apiKey:
+ description: API key as bearer token in Authorization header
+ scheme: bearer
+ type: http
+ bearer:
+ description: API key as bearer token in Authorization header
+ scheme: bearer
+ type: http
+externalDocs:
+ description: OpenRouter Documentation
+ url: https://openrouter.ai/docs
+info:
+ contact:
+ email: support@openrouter.ai
+ name: OpenRouter Support
+ url: https://openrouter.ai/docs
+ description: OpenAI-compatible API with additional OpenRouter features
+ license:
+ name: MIT
+ url: https://opensource.org/licenses/MIT
+ title: OpenRouter API
+ version: 1.0.0
+openapi: 3.1.0
+paths:
+ /activity:
+ get:
+ description: >-
+ Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: getUserActivity
+ parameters:
+ - description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
+ in: query
+ name: date
+ required: false
+ schema:
+ description: Filter by a single UTC date in the last 30 days (YYYY-MM-DD format).
+ example: '2025-08-24'
+ type: string
+ - description: Filter by API key hash (SHA-256 hex string, as returned by the keys API).
+ in: query
+ name: api_key_hash
+ required: false
+ schema:
+ description: Filter by API key hash (SHA-256 hex string, as returned by the keys API).
+ example: abc123def456...
+ type: string
+ - description: Filter by org member user ID. Only applicable for organization accounts.
+ in: query
+ name: user_id
+ required: false
+ schema:
+ description: Filter by org member user ID. Only applicable for organization accounts.
+ example: user_abc123
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - byok_usage_inference: 0.012
+ completion_tokens: 125
+ date: '2025-08-24'
+ endpoint_id: 550e8400-e29b-41d4-a716-446655440000
+ model: openai/gpt-4.1
+ model_permaslug: openai/gpt-4.1-2025-04-14
+ prompt_tokens: 50
+ provider_name: OpenAI
+ reasoning_tokens: 25
+ requests: 5
+ usage: 0.015
+ schema:
+ $ref: '#/components/schemas/ActivityResponse'
+ description: Returns user activity data grouped by endpoint
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: Only management keys can perform this operation
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: Forbidden - Authentication successful but insufficient permissions
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get user activity grouped by endpoint
+ tags:
+ - Analytics
+ /auth/keys:
+ post:
+ description: Exchange an authorization code from the PKCE flow for a user-controlled API key
+ operationId: exchangeAuthCodeForAPIKey
+ requestBody:
+ content:
+ application/json:
+ example:
+ code: auth_code_abc123def456
+ code_challenge_method: S256
+ code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
+ schema:
+ example:
+ code: auth_code_abc123def456
+ code_challenge_method: S256
+ code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
+ properties:
+ code:
+ description: The authorization code received from the OAuth redirect
+ example: auth_code_abc123def456
+ type: string
+ code_challenge_method:
+ description: The method used to generate the code challenge
+ enum:
+ - S256
+ - plain
+ - null
+ example: S256
+ nullable: true
+ type: string
+ code_verifier:
+ description: The code verifier if code_challenge was used in the authorization request
+ example: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
+ type: string
+ required:
+ - code
+ type: object
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ key: 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
+ user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah
+ schema:
+ example:
+ key: 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
+ user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah
+ properties:
+ key:
+ description: The API key to use for OpenRouter requests
+ example: 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
+ type: string
+ user_id:
+ description: User ID associated with the API key
+ example: user_2yOPcMpKoQhcd4bVgSMlELRaIah
+ nullable: true
+ type: string
+ required:
+ - key
+ - user_id
+ type: object
+ description: Successfully exchanged code for an API key
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: Only management keys can perform this operation
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: Forbidden - Authentication successful but insufficient permissions
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Exchange authorization code for API key
+ tags:
+ - OAuth
+ /auth/keys/code:
+ post:
+ description: Create an authorization code for the PKCE flow to generate a user-controlled API key
+ operationId: createAuthKeysCode
+ requestBody:
+ content:
+ application/json:
+ example:
+ callback_url: https://myapp.com/auth/callback
+ code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
+ code_challenge_method: S256
+ limit: 100
+ schema:
+ example:
+ callback_url: https://myapp.com/auth/callback
+ code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
+ code_challenge_method: S256
+ limit: 100
+ properties:
+ callback_url:
+ description: >-
+ The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are
+ allowed.
+ example: https://myapp.com/auth/callback
+ format: uri
+ type: string
+ code_challenge:
+ description: PKCE code challenge for enhanced security
+ example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
+ type: string
+ code_challenge_method:
+ description: The method used to generate the code challenge
+ enum:
+ - S256
+ - plain
+ example: S256
+ type: string
+ expires_at:
+ description: Optional expiration time for the API key to be created
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ key_label:
+ description: Optional custom label for the API key. Defaults to the app name if not provided.
+ example: My Custom Key
+ maxLength: 100
+ type: string
+ limit:
+ description: Credit limit for the API key to be created
+ example: 100
+ format: double
+ type: number
+ spawn_agent:
+ description: Agent identifier for spawn telemetry
+ example: my-agent
+ type: string
+ x-fern-ignore: true
+ x-speakeasy-ignore: true
+ spawn_cloud:
+ description: Cloud identifier for spawn telemetry
+ example: aws-us-east-1
+ type: string
+ x-fern-ignore: true
+ x-speakeasy-ignore: true
+ usage_limit_type:
+ description: Optional credit limit reset interval. When set, the credit limit resets on this interval.
+ enum:
+ - daily
+ - weekly
+ - monthly
+ example: monthly
+ type: string
+ required:
+ - callback_url
+ type: object
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ app_id: 12345
+ created_at: '2025-08-24T10:30:00Z'
+ id: auth_code_xyz789
+ schema:
+ example:
+ data:
+ app_id: 12345
+ created_at: '2025-08-24T10:30:00Z'
+ id: auth_code_xyz789
+ properties:
+ data:
+ description: Auth code data
+ example:
+ app_id: 12345
+ created_at: '2025-08-24T10:30:00Z'
+ id: auth_code_xyz789
+ properties:
+ app_id:
+ description: The application ID associated with this auth code
+ example: 12345
+ type: integer
+ created_at:
+ description: ISO 8601 timestamp of when the auth code was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ id:
+ description: The authorization code ID to use in the exchange request
+ example: auth_code_xyz789
+ type: string
+ required:
+ - id
+ - app_id
+ - created_at
+ type: object
+ required:
+ - data
+ type: object
+ description: Successfully created authorization code
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '409':
+ content:
+ application/json:
+ example:
+ error:
+ code: 409
+ message: Resource conflict. Please try again later.
+ schema:
+ $ref: '#/components/schemas/ConflictResponse'
+ description: Conflict - Resource conflict or concurrent modification
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Create authorization code
+ tags:
+ - OAuth
+ x-speakeasy-name-override: createAuthCode
+ /chat/completions:
+ post:
+ description: >-
+ Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming
+ modes.
+ operationId: sendChatCompletionRequest
+ requestBody:
+ content:
+ application/json:
+ example:
+ max_tokens: 150
+ messages:
+ - content: You are a helpful assistant.
+ role: system
+ - content: What is the capital of France?
+ role: user
+ model: openai/gpt-4
+ temperature: 0.7
+ schema:
+ $ref: '#/components/schemas/ChatRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ choices:
+ - finish_reason: stop
+ index: 0
+ message:
+ content: The capital of France is Paris.
+ role: assistant
+ created: 1677652288
+ id: chatcmpl-123
+ model: openai/gpt-4
+ object: chat.completion
+ usage:
+ completion_tokens: 10
+ prompt_tokens: 25
+ total_tokens: 35
+ schema:
+ $ref: '#/components/schemas/ChatResult'
+ text/event-stream:
+ example:
+ data:
+ choices:
+ - delta:
+ content: Hello
+ role: assistant
+ finish_reason: null
+ index: 0
+ created: 1677652288
+ id: chatcmpl-123
+ model: openai/gpt-4
+ object: chat.completion.chunk
+ schema:
+ properties:
+ data:
+ $ref: '#/components/schemas/ChatStreamChunk'
+ required:
+ - data
+ type: object
+ x-speakeasy-sse-sentinel: '[DONE]'
+ description: Successful chat completion response
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '402':
+ content:
+ application/json:
+ example:
+ error:
+ code: 402
+ message: Insufficient credits. Add more using https://openrouter.ai/credits
+ schema:
+ $ref: '#/components/schemas/PaymentRequiredResponse'
+ description: Payment Required - Insufficient credits or quota to complete request
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '408':
+ content:
+ application/json:
+ example:
+ error:
+ code: 408
+ message: Operation timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/RequestTimeoutResponse'
+ description: Request Timeout - Operation exceeded time limit
+ '413':
+ content:
+ application/json:
+ example:
+ error:
+ code: 413
+ message: Request payload too large
+ schema:
+ $ref: '#/components/schemas/PayloadTooLargeResponse'
+ description: Payload Too Large - Request payload exceeds size limits
+ '422':
+ content:
+ application/json:
+ example:
+ error:
+ code: 422
+ message: Invalid argument
+ schema:
+ $ref: '#/components/schemas/UnprocessableEntityResponse'
+ description: Unprocessable Entity - Semantic validation failure
+ '429':
+ content:
+ application/json:
+ example:
+ error:
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: Bad Gateway - Provider/upstream API failure
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: Service temporarily unavailable
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: Service Unavailable - Service temporarily unavailable
+ '524':
+ content:
+ application/json:
+ example:
+ error:
+ code: 524
+ message: Request timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
+ description: Infrastructure Timeout - Provider request timed out at edge network
+ '529':
+ content:
+ application/json:
+ example:
+ error:
+ code: 529
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/ProviderOverloadedResponse'
+ description: Provider Overloaded - Provider is temporarily overloaded
+ summary: Create a chat completion
+ tags:
+ - Chat
+ x-speakeasy-group: chat
+ x-speakeasy-name-override: send
+ x-speakeasy-stream-request-field: stream
+ /credits:
+ get:
+ description: >-
+ Get total credits purchased and used for the authenticated user. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: getCredits
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ total_credits: 100.5
+ total_usage: 25.75
+ schema:
+ description: Total credits purchased and used
+ example:
+ data:
+ total_credits: 100.5
+ total_usage: 25.75
+ properties:
+ data:
+ example:
+ total_credits: 100.5
+ total_usage: 25.75
+ properties:
+ total_credits:
+ description: Total credits purchased
+ example: 100.5
+ format: double
+ type: number
+ total_usage:
+ description: Total credits used
+ example: 25.75
+ format: double
+ type: number
+ required:
+ - total_credits
+ - total_usage
+ type: object
+ required:
+ - data
+ type: object
+ description: Returns the total credits purchased and used
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '403':
+ content:
+ application/json:
+ example:
+ error:
+ code: 403
+ message: Only management keys can perform this operation
+ schema:
+ $ref: '#/components/schemas/ForbiddenResponse'
+ description: Forbidden - Authentication successful but insufficient permissions
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get remaining credits
+ tags:
+ - Credits
+ x-speakeasy-name-override: getCredits
+ /credits/coinbase:
+ post:
+ deprecated: true
+ description: >-
+ Deprecated. The Coinbase APIs used by this endpoint have been deprecated, so Coinbase Commerce charges have been
+ removed. Use the web credits purchase flow instead.
+ operationId: createCoinbaseCharge
+ responses:
+ '200':
+ description: This endpoint is deprecated and will never return a 200 response.
+ '410':
+ content:
+ application/json:
+ example:
+ error:
+ code: 410
+ message: >-
+ The Coinbase APIs used by this endpoint have been deprecated, so the Coinbase Commerce credits API
+ has been removed. Use the web credits purchase flow instead.
+ schema:
+ $ref: '#/components/schemas/GoneResponse'
+ description: Gone - Endpoint has been permanently removed or deprecated
+ security: []
+ summary: Deprecated Coinbase Commerce charge endpoint
+ tags:
+ - Credits
+ x-fern-ignore: true
+ x-speakeasy-ignore: true
+ x-speakeasy-name-override: createCoinbaseCharge
+ /embeddings:
+ post:
+ description: Submits an embedding request to the embeddings router
+ operationId: createEmbeddings
+ requestBody:
+ content:
+ application/json:
+ example:
+ input: The quick brown fox jumps over the lazy dog
+ model: openai/text-embedding-3-small
+ schema:
+ description: Embeddings request input
+ example:
+ dimensions: 1536
+ input: The quick brown fox jumps over the lazy dog
+ model: openai/text-embedding-3-small
+ properties:
+ dimensions:
+ description: The number of dimensions for the output embeddings
+ example: 1536
+ exclusiveMinimum: 0
+ minimum: 0
+ type: integer
+ encoding_format:
+ description: The format of the output embeddings
+ enum:
+ - float
+ - base64
+ example: float
+ type: string
+ input:
+ anyOf:
+ - type: string
+ - items:
+ type: string
+ type: array
+ - items:
+ type: number
+ type: array
+ - items:
+ items:
+ type: number
+ type: array
+ type: array
+ - items:
+ properties:
+ content:
+ items:
+ oneOf:
+ - properties:
+ text:
+ type: string
+ type:
+ enum:
+ - text
+ type: string
+ required:
+ - type
+ - text
+ type: object
+ - properties:
+ image_url:
+ properties:
+ url:
+ type: string
+ required:
+ - url
+ type: object
+ type:
+ enum:
+ - image_url
+ type: string
+ required:
+ - type
+ - image_url
+ type: object
+ type: array
+ required:
+ - content
+ type: object
+ type: array
+ description: Text, token, or multimodal input(s) to embed
+ example: The quick brown fox jumps over the lazy dog
+ input_type:
+ description: The type of input (e.g. search_query, search_document)
+ example: search_query
+ type: string
+ model:
+ description: The model to use for embeddings
+ example: openai/text-embedding-3-small
+ type: string
+ provider:
+ allOf:
+ - $ref: '#/components/schemas/ProviderPreferences'
+ - description: Provider routing preferences for the request.
+ user:
+ description: A unique identifier for the end-user
+ example: user-1234
+ type: string
+ required:
+ - input
+ - model
+ type: object
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - embedding:
+ - 0.0023064255
+ - -0.009327292
+ - 0.015797347
+ index: 0
+ object: embedding
+ model: openai/text-embedding-3-small
+ object: list
+ usage:
+ prompt_tokens: 8
+ total_tokens: 8
+ schema:
+ description: Embeddings response containing embedding vectors
+ example:
+ data:
+ - embedding:
+ - 0.0023064255
+ - -0.009327292
+ - 0.015797347
+ index: 0
+ object: embedding
+ model: openai/text-embedding-3-small
+ object: list
+ usage:
+ prompt_tokens: 8
+ total_tokens: 8
+ properties:
+ data:
+ description: List of embedding objects
+ example:
+ - embedding:
+ - 0.0023064255
+ - -0.009327292
+ - 0.015797347
+ index: 0
+ object: embedding
+ items:
+ description: A single embedding object
+ example:
+ embedding:
+ - 0.0023064255
+ - -0.009327292
+ - 0.015797347
+ index: 0
+ object: embedding
+ properties:
+ embedding:
+ anyOf:
+ - items:
+ type: number
+ type: array
+ - type: string
+ description: Embedding vector as an array of floats or a base64 string
example:
- - US
- - IE
+ - 0.0023064255
+ - -0.009327292
+ - 0.015797347
+ index:
+ description: Index of the embedding in the input list
+ example: 0
+ type: integer
+ object:
+ enum:
+ - embedding
+ type: string
required:
- - name
- - slug
- - privacy_policy_url
- example:
- name: OpenAI
- slug: openai
- privacy_policy_url: https://openai.com/privacy
- terms_of_service_url: https://openai.com/terms
- status_page_url: https://status.openai.com
- headquarters: US
- datacenters:
- - US
- - IE
+ - object
+ - embedding
+ type: object
+ type: array
+ id:
+ description: Unique identifier for the embeddings response
+ example: embd-1234567890
+ type: string
+ model:
+ description: The model used for embeddings
+ example: openai/text-embedding-3-small
+ type: string
+ object:
+ enum:
+ - list
+ type: string
+ usage:
+ description: Token usage statistics
+ example:
+ prompt_tokens: 8
+ total_tokens: 8
+ properties:
+ cost:
+ description: Cost of the request in credits
+ example: 0.0001
+ format: double
+ type: number
+ prompt_tokens:
+ description: Number of tokens in the input
+ example: 8
+ type: integer
+ total_tokens:
+ description: Total number of tokens used
+ example: 8
+ type: integer
+ required:
+ - prompt_tokens
+ - total_tokens
+ type: object
+ required:
+ - object
+ - data
+ - model
+ type: object
+ text/event-stream:
+ example: 'data: [DONE]'
+ schema:
+ description: Not used for embeddings - embeddings do not support streaming
+ type: string
+ x-speakeasy-sse-sentinel: '[DONE]'
+ description: Embedding response
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '402':
+ content:
+ application/json:
+ example:
+ error:
+ code: 402
+ message: Insufficient credits. Add more using https://openrouter.ai/credits
+ schema:
+ $ref: '#/components/schemas/PaymentRequiredResponse'
+ description: Payment Required - Insufficient credits or quota to complete request
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '429':
+ content:
+ application/json:
+ example:
+ error:
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: Bad Gateway - Provider/upstream API failure
+ '503':
+ content:
+ application/json:
+ example:
+ error:
+ code: 503
+ message: Service temporarily unavailable
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: Service Unavailable - Service temporarily unavailable
+ '524':
+ content:
+ application/json:
+ example:
+ error:
+ code: 524
+ message: Request timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
+ description: Infrastructure Timeout - Provider request timed out at edge network
+ '529':
+ content:
+ application/json:
+ example:
+ error:
+ code: 529
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/ProviderOverloadedResponse'
+ description: Provider Overloaded - Provider is temporarily overloaded
+ summary: Submit an embedding request
+ tags:
+ - Embeddings
+ x-speakeasy-name-override: generate
+ /embeddings/models:
+ get:
+ description: Returns a list of all available embeddings models and their properties
+ operationId: listEmbeddingsModels
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - architecture:
+ input_modalities:
+ - text
+ instruct_type: null
+ modality: text->text
+ output_modalities:
+ - embeddings
+ tokenizer: GPT
+ canonical_slug: openai/text-embedding-3-small
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: OpenAI text embedding model optimized for performance.
+ expiration_date: null
+ id: openai/text-embedding-3-small
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/text-embedding-3-small/endpoints
+ name: Text Embedding 3 Small
+ per_request_limits: null
+ pricing:
+ completion: '0'
+ image: '0'
+ prompt: '0.00000002'
+ request: '0'
+ supported_parameters: []
+ top_provider:
+ context_length: 8192
+ is_moderated: false
+ max_completion_tokens: null
+ schema:
+ $ref: '#/components/schemas/ModelsListResponse'
+ description: Returns a list of embeddings models
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all embeddings models
+ tags:
+ - Embeddings
+ x-speakeasy-name-override: listModels
+ /endpoints/zdr:
+ get:
+ operationId: listEndpointsZdr
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - context_length: 8192
+ latency_last_30m:
+ p50: 0.25
+ p75: 0.35
+ p90: 0.48
+ p99: 0.85
+ max_completion_tokens: 4096
+ max_prompt_tokens: 8192
+ model_id: openai/gpt-4
+ model_name: GPT-4
+ name: 'OpenAI: GPT-4'
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ provider_name: OpenAI
+ quantization: fp16
+ status: default
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ supports_implicit_caching: true
+ tag: openai
+ throughput_last_30m:
+ p50: 45.2
+ p75: 38.5
+ p90: 28.3
+ p99: 15.1
+ uptime_last_1d: 99.8
+ uptime_last_30m: 99.5
+ uptime_last_5m: 100
+ schema:
+ example:
+ data:
+ - context_length: 8192
+ latency_last_30m:
+ p50: 0.25
+ p75: 0.35
+ p90: 0.48
+ p99: 0.85
+ max_completion_tokens: 4096
+ max_prompt_tokens: 8192
+ model_id: openai/gpt-4
+ model_name: GPT-4
+ name: 'OpenAI: GPT-4'
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ provider_name: OpenAI
+ quantization: fp16
+ status: default
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ supports_implicit_caching: true
+ tag: openai
+ throughput_last_30m:
+ p50: 45.2
+ p75: 38.5
+ p90: 28.3
+ p99: 15.1
+ uptime_last_1d: 99.8
+ uptime_last_30m: 99.5
+ uptime_last_5m: 100
+ properties:
+ data:
+ items:
+ $ref: '#/components/schemas/PublicEndpoint'
+ type: array
+ required:
+ - data
+ type: object
+ description: Returns a list of endpoints
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Preview the impact of ZDR on the available endpoints
+ tags:
+ - Endpoints
+ x-speakeasy-name-override: listZdrEndpoints
+ /generation:
+ get:
+ operationId: getGeneration
+ parameters:
+ - description: The generation ID
+ in: query
+ name: id
+ required: true
+ schema:
+ description: The generation ID
+ example: gen-1234567890
+ minLength: 1
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ api_type: null
+ app_id: 12345
+ cache_discount: 0.0002
+ cancelled: false
+ created_at: '2024-07-15T23:33:19.433273+00:00'
+ external_user: user-123
+ finish_reason: stop
+ generation_time: 1200
+ http_referer: null
+ id: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
+ is_byok: false
+ latency: 1250
+ model: sao10k/l3-stheno-8b
+ moderation_latency: 50
+ native_finish_reason: stop
+ native_tokens_cached: 3
+ native_tokens_completion: 25
+ native_tokens_completion_images: 0
+ native_tokens_prompt: 10
+ native_tokens_reasoning: 5
+ num_input_audio_prompt: 0
+ num_media_completion: 0
+ num_media_prompt: 1
+ num_search_results: 5
+ origin: https://openrouter.ai/
+ provider_name: Infermatic
+ provider_responses: null
+ request_id: req-1727282430-aBcDeFgHiJkLmNoPqRsT
+ router: null
+ streamed: true
+ tokens_completion: 25
+ tokens_prompt: 10
+ total_cost: 0.0015
+ upstream_id: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
+ upstream_inference_cost: 0.0012
+ usage: 0.0015
+ user_agent: null
+ schema:
+ description: Generation response
+ properties:
+ data:
+ description: Generation data
+ properties:
+ api_type:
+ description: Type of API used for the generation
+ enum:
+ - completions
+ - embeddings
+ - rerank
+ - video
+ - null
+ nullable: true
+ type: string
+ app_id:
+ description: ID of the app that made the request
+ example: 12345
+ type: integer
+ cache_discount:
+ description: Discount applied due to caching
+ example: 0.0002
+ format: double
+ type: number
+ cancelled:
+ description: Whether the generation was cancelled
+ example: false
+ nullable: true
+ type: boolean
+ created_at:
+ description: ISO 8601 timestamp of when the generation was created
+ example: '2024-07-15T23:33:19.433273+00:00'
+ type: string
+ external_user:
+ description: External user identifier
+ example: user-123
+ nullable: true
+ type: string
+ finish_reason:
+ description: Reason the generation finished
+ example: stop
+ nullable: true
+ type: string
+ generation_time:
+ description: Time taken for generation in milliseconds
+ example: 1200
+ format: double
+ type: number
+ http_referer:
+ description: Referer header from the request
+ nullable: true
+ type: string
+ id:
+ description: Unique identifier for the generation
+ example: gen-3bhGkxlo4XFrqiabUM7NDtwDzWwG
+ type: string
+ is_byok:
+ description: Whether this used bring-your-own-key
+ example: false
+ type: boolean
+ latency:
+ description: Total latency in milliseconds
+ example: 1250
+ format: double
+ type: number
+ model:
+ description: Model used for the generation
+ example: sao10k/l3-stheno-8b
+ type: string
+ moderation_latency:
+ description: Moderation latency in milliseconds
+ example: 50
+ format: double
+ type: number
+ native_finish_reason:
+ description: Native finish reason as reported by provider
+ example: stop
+ nullable: true
+ type: string
+ native_tokens_cached:
+ description: Native cached tokens as reported by provider
+ example: 3
+ type: integer
+ native_tokens_completion:
+ description: Native completion tokens as reported by provider
+ example: 25
+ type: integer
+ native_tokens_completion_images:
+ description: Native completion image tokens as reported by provider
+ example: 0
+ type: integer
+ native_tokens_prompt:
+ description: Native prompt tokens as reported by provider
+ example: 10
+ type: integer
+ native_tokens_reasoning:
+ description: Native reasoning tokens as reported by provider
+ example: 5
+ type: integer
+ num_input_audio_prompt:
+ description: Number of audio inputs in the prompt
+ example: 0
+ type: integer
+ num_media_completion:
+ description: Number of media items in the completion
+ example: 0
+ type: integer
+ num_media_prompt:
+ description: Number of media items in the prompt
+ example: 1
+ type: integer
+ num_search_results:
+ description: Number of search results included
+ example: 5
+ type: integer
+ origin:
+ description: Origin URL of the request
+ example: https://openrouter.ai/
+ type: string
+ provider_name:
+ description: Name of the provider that served the request
+ example: Infermatic
+ nullable: true
+ type: string
+ provider_responses:
+ description: List of provider responses for this generation, including fallback attempts
+ items:
+ $ref: '#/components/schemas/ProviderResponse'
+ nullable: true
+ type: array
+ request_id:
+ description: Unique identifier grouping all generations from a single API request
+ example: req-1727282430-aBcDeFgHiJkLmNoPqRsT
+ nullable: true
+ type: string
+ router:
+ description: Router used for the request (e.g., openrouter/auto)
+ example: openrouter/auto
+ nullable: true
+ type: string
+ session_id:
+ description: Session identifier grouping multiple generations in the same session
+ nullable: true
+ type: string
+ streamed:
+ description: Whether the response was streamed
+ example: true
+ nullable: true
+ type: boolean
+ tokens_completion:
+ description: Number of tokens in the completion
+ example: 25
+ type: integer
+ tokens_prompt:
+ description: Number of tokens in the prompt
+ example: 10
+ type: integer
+ total_cost:
+ description: Total cost of the generation in USD
+ example: 0.0015
+ format: double
+ type: number
+ upstream_id:
+ description: Upstream provider's identifier for this generation
+ example: chatcmpl-791bcf62-080e-4568-87d0-94c72e3b4946
+ nullable: true
+ type: string
+ upstream_inference_cost:
+ description: Cost charged by the upstream provider
+ example: 0.0012
+ format: double
+ type: number
+ usage:
+ description: Usage amount in USD
+ example: 0.0015
+ format: double
+ type: number
+ user_agent:
+ description: User-Agent header from the request
+ nullable: true
+ type: string
+ required:
+ - id
+ - upstream_id
+ - total_cost
+ - cache_discount
+ - upstream_inference_cost
+ - created_at
+ - model
+ - app_id
+ - streamed
+ - cancelled
+ - provider_name
+ - latency
+ - moderation_latency
+ - generation_time
+ - finish_reason
+ - tokens_prompt
+ - tokens_completion
+ - native_tokens_prompt
+ - native_tokens_completion
+ - native_tokens_completion_images
+ - native_tokens_reasoning
+ - native_tokens_cached
+ - num_media_prompt
+ - num_input_audio_prompt
+ - num_media_completion
+ - num_search_results
+ - origin
+ - usage
+ - is_byok
+ - native_finish_reason
+ - external_user
+ - api_type
+ - router
+ - provider_responses
+ - user_agent
+ - http_referer
+ type: object
required:
- data
- example:
- data:
- - name: OpenAI
- slug: openai
- privacy_policy_url: https://openai.com/privacy
- terms_of_service_url: https://openai.com/terms
- status_page_url: https://status.openai.com
- headquarters: US
- datacenters:
- - US
- - IE
+ type: object
+ description: Returns the request metadata for this generation
+ '401':
+ content:
+ application/json:
example:
- data:
- - name: OpenAI
- slug: openai
- privacy_policy_url: https://openai.com/privacy
- terms_of_service_url: https://openai.com/terms
- status_page_url: https://status.openai.com
- headquarters: US
- datacenters:
- - US
- - IE
- '500':
- description: Internal Server Error - Unexpected server error
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '402':
+ content:
+ application/json:
+ example:
+ error:
+ code: 402
+ message: Insufficient credits. Add more using https://openrouter.ai/credits
+ schema:
+ $ref: '#/components/schemas/PaymentRequiredResponse'
+ description: Payment Required - Insufficient credits or quota to complete request
+ '404':
content:
application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
schema:
- $ref: '#/components/schemas/InternalServerResponse'
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '429':
+ content:
+ application/json:
+ example:
+ error:
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
+ '500':
+ content:
+ application/json:
example:
error:
code: 500
message: Internal Server Error
- /keys:
- get:
- operationId: list
- x-speakeasy-name-override: list
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ '502':
+ content:
+ application/json:
+ example:
+ error:
+ code: 502
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: Bad Gateway - Provider/upstream API failure
+ '524':
+ content:
+ application/json:
+ example:
+ error:
+ code: 524
+ message: Request timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
+ description: Infrastructure Timeout - Provider request timed out at edge network
+ '529':
+ content:
+ application/json:
+ example:
+ error:
+ code: 529
+ message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/ProviderOverloadedResponse'
+ description: Provider Overloaded - Provider is temporarily overloaded
+ summary: Get request & usage metadata for a generation
tags:
- - API Keys
- summary: List API keys
+ - Generations
+ /guardrails:
+ get:
description: >-
- List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys)
+ List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys)
required.
- parameters:
- - schema:
- type: string
- description: Whether to include disabled API keys in the response
- example: 'false'
- x-openrouter-type: boolean
- required: false
- description: Whether to include disabled API keys in the response
- name: include_disabled
+ operationId: listGuardrails
+ parameters:
+ - description: Number of records to skip for pagination
in: query
- - schema:
- type: integer
- minimum: 0
- description: Number of API keys to skip for pagination
- example: 0
- required: false
- description: Number of API keys to skip for pagination
name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
responses:
'200':
- description: List of API keys
content:
application/json:
- schema:
- type: object
- properties:
- data:
- type: array
- items:
- type: object
- properties:
- hash:
- type: string
- description: Unique hash identifier for the API key
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name:
- type: string
- description: Name of the API key
- example: My Production Key
- label:
- type: string
- description: Human-readable label for the API key
- example: sk-or-v1-0e6...1c96
- disabled:
- type: boolean
- description: Whether the API key is disabled
- example: false
- limit:
- type: number
- format: double
- description: Spending limit for the API key in USD
- example: 100
- limit_remaining:
- type: number
- format: double
- description: Remaining spending limit in USD
- example: 74.5
- limit_reset:
- type: string
- nullable: true
- description: Type of limit reset for the API key
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include external BYOK usage in the credit limit
- example: false
- usage:
- type: number
- format: double
- description: Total OpenRouter credit usage (in USD) for the API key
- example: 25.5
- usage_daily:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC day
- example: 25.5
- usage_weekly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
- example: 25.5
- usage_monthly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC month
- example: 25.5
- byok_usage:
- type: number
- format: double
- description: Total external BYOK usage (in USD) for the API key
- example: 17.38
- byok_usage_daily:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC day
- example: 17.38
- byok_usage_weekly:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
- example: 17.38
- byok_usage_monthly:
- type: number
- format: double
- description: External BYOK usage (in USD) for current UTC month
- example: 17.38
- created_at:
- type: string
- description: ISO 8601 timestamp of when the API key was created
- example: '2025-08-24T10:30:00Z'
- updated_at:
- type: string
- nullable: true
- description: ISO 8601 timestamp of when the API key was last updated
- example: '2025-08-24T15:45:00Z'
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- description: >-
- The user ID of the key creator. For organization-owned keys, this is the member who created
- the key. For individual users, this is the user's own ID.
- example: user_2dHFtVWx2n56w6HkM0000000000
- required:
- - hash
- - name
- - label
- - disabled
- - limit
- - limit_remaining
- - limit_reset
- - include_byok_in_limit
- - usage
- - usage_daily
- - usage_weekly
- - usage_monthly
- - byok_usage
- - byok_usage_daily
- - byok_usage_weekly
- - byok_usage_monthly
- - created_at
- - updated_at
- - creator_user_id
- example:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: sk-or-v1-0e6...1c96
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- description: List of API keys
- required:
- - data
- example:
- data:
- - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: Production API Key
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
example:
data:
- - hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: Production API Key
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
+ - allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
created_at: '2025-08-24T10:30:00Z'
+ description: Guardrail for production environment
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 100
+ name: Production Guardrail
+ reset_interval: monthly
updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ total_count: 1
+ schema:
+ $ref: '#/components/schemas/ListGuardrailsResponse'
+ description: List of guardrails
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
- '429':
- description: Too Many Requests - Rate limit exceeded
- content:
- application/json:
schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
- example:
- error:
- code: 429
- message: Rate limit exceeded
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- post:
- x-speakeasy-name-override: create
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List guardrails
tags:
- - API Keys
- summary: Create a new API key
+ - Guardrails
+ x-speakeasy-name-override: list
+ x-speakeasy-pagination:
+ inputs:
+ - in: parameters
+ name: offset
+ type: offset
+ - in: parameters
+ name: limit
+ type: limit
+ outputs:
+ results: $.data
+ type: offsetLimit
+ post:
description: >-
- Create a new API key for the authenticated user. [Management
+ Create a new guardrail for the authenticated user. [Management
key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: createGuardrail
requestBody:
content:
application/json:
- schema:
- type: object
- properties:
- name:
- type: string
- minLength: 1
- description: Name for the new API key
- example: My New API Key
- limit:
- type: number
- format: double
- description: Optional spending limit for the API key in USD
- example: 50
- limit_reset:
- type: string
- nullable: true
- enum:
- - daily
- - weekly
- - monthly
- - null
- description: >-
- Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen
- automatically at midnight UTC, and weeks are Monday through Sunday.
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include BYOK usage in the limit
- example: true
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: >-
- Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be
- rejected
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- minLength: 1
- description: >-
- Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific
- member is creating the key.
- example: user_2dHFtVWx2n56w6HkM0000000000
- required:
- - name
- example:
- name: My New API Key
- limit: 50
- limit_reset: monthly
- include_byok_in_limit: true
- expires_at: '2027-12-31T23:59:59Z'
example:
- name: My New API Key
- limit: 50
- limit_reset: monthly
- include_byok_in_limit: true
- expires_at: '2027-12-31T23:59:59Z'
- required: true
- responses:
- '201':
- description: API key created successfully
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- hash:
- type: string
- description: Unique hash identifier for the API key
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name:
- type: string
- description: Name of the API key
- example: My Production Key
- label:
- type: string
- description: Human-readable label for the API key
- example: sk-or-v1-0e6...1c96
- disabled:
- type: boolean
- description: Whether the API key is disabled
- example: false
- limit:
- type: number
- format: double
- description: Spending limit for the API key in USD
- example: 100
- limit_remaining:
- type: number
- format: double
- description: Remaining spending limit in USD
- example: 74.5
- limit_reset:
- type: string
- nullable: true
- description: Type of limit reset for the API key
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include external BYOK usage in the credit limit
- example: false
- usage:
- type: number
- format: double
- description: Total OpenRouter credit usage (in USD) for the API key
- example: 25.5
- usage_daily:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC day
- example: 25.5
- usage_weekly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
- example: 25.5
- usage_monthly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC month
- example: 25.5
- byok_usage:
- type: number
- format: double
- description: Total external BYOK usage (in USD) for the API key
- example: 17.38
- byok_usage_daily:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC day
- example: 17.38
- byok_usage_weekly:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
- example: 17.38
- byok_usage_monthly:
- type: number
- format: double
- description: External BYOK usage (in USD) for current UTC month
- example: 17.38
- created_at:
- type: string
- description: ISO 8601 timestamp of when the API key was created
- example: '2025-08-24T10:30:00Z'
- updated_at:
- type: string
- nullable: true
- description: ISO 8601 timestamp of when the API key was last updated
- example: '2025-08-24T15:45:00Z'
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- description: >-
- The user ID of the key creator. For organization-owned keys, this is the member who created
- the key. For individual users, this is the user's own ID.
- example: user_2dHFtVWx2n56w6HkM0000000000
- required:
- - hash
- - name
- - label
- - disabled
- - limit
- - limit_remaining
- - limit_reset
- - include_byok_in_limit
- - usage
- - usage_daily
- - usage_weekly
- - usage_monthly
- - byok_usage
- - byok_usage_daily
- - byok_usage_weekly
- - byok_usage_monthly
- - created_at
- - updated_at
- - creator_user_id
- example:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: sk-or-v1-0e6...1c96
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- description: The created API key information
- key:
- type: string
- description: The actual API key string (only shown once)
- example: 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
- required:
- - data
- - key
- example:
- data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My New API Key
- label: My New API Key
- disabled: false
- limit: 50
- limit_remaining: 50
- limit_reset: monthly
- include_byok_in_limit: true
- usage: 0
- usage_daily: 0
- usage_weekly: 0
- usage_monthly: 0
- byok_usage: 0
- byok_usage_daily: 0
- byok_usage_weekly: 0
- byok_usage_monthly: 0
- created_at: '2025-08-24T10:30:00Z'
- updated_at: null
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- key: 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
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - deepseek
+ description: A guardrail for limiting API usage
+ enforce_zdr: false
+ ignored_providers: null
+ limit_usd: 50
+ name: My New Guardrail
+ reset_interval: monthly
+ schema:
+ $ref: '#/components/schemas/CreateGuardrailRequest'
+ required: true
+ responses:
+ '201':
+ content:
+ application/json:
example:
data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My New API Key
- label: My New API Key
- disabled: false
- limit: 50
- limit_remaining: 50
- limit_reset: monthly
- include_byok_in_limit: true
- usage: 0
- usage_daily: 0
- usage_weekly: 0
- usage_monthly: 0
- byok_usage: 0
- byok_usage_daily: 0
- byok_usage_weekly: 0
- byok_usage_monthly: 0
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
created_at: '2025-08-24T10:30:00Z'
+ description: A guardrail for limiting API usage
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 50
+ name: My New Guardrail
+ reset_interval: monthly
updated_at: null
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- key: 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
+ schema:
+ $ref: '#/components/schemas/CreateGuardrailResponse'
+ description: Guardrail created successfully
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Create a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: create
+ /guardrails/{id}:
+ delete:
+ description: Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: deleteGuardrail
+ parameters:
+ - description: The unique identifier of the guardrail to delete
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail to delete
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ deleted: true
+ schema:
+ $ref: '#/components/schemas/DeleteGuardrailResponse'
+ description: Guardrail deleted successfully
+ '401':
+ content:
+ application/json:
example:
error:
code: 401
message: Missing Authentication header
- '429':
- description: Too Many Requests - Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
content:
application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
example:
error:
- code: 429
- message: Rate limit exceeded
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
schema:
$ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Delete a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: delete
+ get:
+ description: Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: getGuardrail
+ parameters:
+ - description: The unique identifier of the guardrail to retrieve
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail to retrieve
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ - anthropic
+ - google
+ created_at: '2025-08-24T10:30:00Z'
+ description: Guardrail for production environment
+ enforce_zdr: false
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 100
+ name: Production Guardrail
+ reset_interval: monthly
+ updated_at: '2025-08-24T15:45:00Z'
+ schema:
+ $ref: '#/components/schemas/GetGuardrailResponse'
+ description: Guardrail details
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
example:
error:
code: 500
message: Internal Server Error
- operationId: createKeys
- /keys/{hash}:
- patch:
- x-speakeasy-name-override: update
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get a guardrail
tags:
- - API Keys
- summary: Update an API key
- description: Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ - Guardrails
+ x-speakeasy-name-override: get
+ patch:
+ description: Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: updateGuardrail
parameters:
- - schema:
- type: string
- description: The hash identifier of the API key to update
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- required: true
- description: The hash identifier of the API key to update
- name: hash
+ - description: The unique identifier of the guardrail to update
in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail to update
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
requestBody:
content:
application/json:
+ example:
+ description: Updated description
+ limit_usd: 75
+ name: Updated Guardrail Name
+ reset_interval: weekly
schema:
- type: object
- properties:
- name:
- type: string
- description: New name for the API key
- example: Updated API Key Name
- disabled:
- type: boolean
- description: Whether to disable the API key
- example: false
- limit:
- type: number
- format: double
- description: New spending limit for the API key in USD
- example: 75
- limit_reset:
- type: string
- nullable: true
- enum:
- - daily
- - weekly
- - monthly
- - null
- description: >-
- New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen
- automatically at midnight UTC, and weeks are Monday through Sunday.
- example: daily
- include_byok_in_limit:
- type: boolean
- description: Whether to include BYOK usage in the limit
- example: true
+ $ref: '#/components/schemas/UpdateGuardrailRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ allowed_models: null
+ allowed_providers:
+ - openai
+ created_at: '2025-08-24T10:30:00Z'
+ description: Updated description
+ enforce_zdr: true
+ id: 550e8400-e29b-41d4-a716-446655440000
+ ignored_providers: null
+ limit_usd: 75
+ name: Updated Guardrail Name
+ reset_interval: weekly
+ updated_at: '2025-08-24T16:00:00Z'
+ schema:
+ $ref: '#/components/schemas/UpdateGuardrailResponse'
+ description: Guardrail updated successfully
+ '400':
+ content:
+ application/json:
example:
- name: Updated API Key Name
- disabled: false
- limit: 75
- limit_reset: daily
- include_byok_in_limit: true
- example:
- name: Updated API Key Name
- disabled: false
- limit: 75
- limit_reset: daily
- include_byok_in_limit: true
- required: true
- responses:
- '200':
- description: API key updated successfully
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
content:
application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
schema:
- type: object
- properties:
- data:
- type: object
- properties:
- hash:
- type: string
- description: Unique hash identifier for the API key
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name:
- type: string
- description: Name of the API key
- example: My Production Key
- label:
- type: string
- description: Human-readable label for the API key
- example: sk-or-v1-0e6...1c96
- disabled:
- type: boolean
- description: Whether the API key is disabled
- example: false
- limit:
- type: number
- format: double
- description: Spending limit for the API key in USD
- example: 100
- limit_remaining:
- type: number
- format: double
- description: Remaining spending limit in USD
- example: 74.5
- limit_reset:
- type: string
- nullable: true
- description: Type of limit reset for the API key
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include external BYOK usage in the credit limit
- example: false
- usage:
- type: number
- format: double
- description: Total OpenRouter credit usage (in USD) for the API key
- example: 25.5
- usage_daily:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC day
- example: 25.5
- usage_weekly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
- example: 25.5
- usage_monthly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC month
- example: 25.5
- byok_usage:
- type: number
- format: double
- description: Total external BYOK usage (in USD) for the API key
- example: 17.38
- byok_usage_daily:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC day
- example: 17.38
- byok_usage_weekly:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
- example: 17.38
- byok_usage_monthly:
- type: number
- format: double
- description: External BYOK usage (in USD) for current UTC month
- example: 17.38
- created_at:
- type: string
- description: ISO 8601 timestamp of when the API key was created
- example: '2025-08-24T10:30:00Z'
- updated_at:
- type: string
- nullable: true
- description: ISO 8601 timestamp of when the API key was last updated
- example: '2025-08-24T15:45:00Z'
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- description: >-
- The user ID of the key creator. For organization-owned keys, this is the member who created
- the key. For individual users, this is the user's own ID.
- example: user_2dHFtVWx2n56w6HkM0000000000
- required:
- - hash
- - name
- - label
- - disabled
- - limit
- - limit_remaining
- - limit_reset
- - include_byok_in_limit
- - usage
- - usage_daily
- - usage_weekly
- - usage_monthly
- - byok_usage
- - byok_usage_daily
- - byok_usage_weekly
- - byok_usage_monthly
- - created_at
- - updated_at
- - creator_user_id
- example:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: sk-or-v1-0e6...1c96
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- description: The updated API key information
- required:
- - data
- example:
- data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: Updated API Key Name
- label: Updated API Key Name
- disabled: false
- limit: 75
- limit_remaining: 49.5
- limit_reset: daily
- include_byok_in_limit: true
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T16:00:00Z'
- expires_at: null
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Update a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: update
+ /guardrails/{id}/assignments/keys:
+ get:
+ description: >-
+ List all API key assignments for a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: listGuardrailKeyAssignments
+ parameters:
+ - description: The unique identifier of the guardrail
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ - description: Number of records to skip for pagination
+ in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
+ in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
+ responses:
+ '200':
+ content:
+ application/json:
example:
data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: Updated API Key Name
- label: Updated API Key Name
- disabled: false
- limit: 75
- limit_remaining: 49.5
- limit_reset: daily
- include_byok_in_limit: true
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T16:00:00Z'
- expires_at: null
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- '400':
- description: Bad Request - Invalid request parameters or malformed input
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ key_label: prod-key
+ key_name: Production Key
+ total_count: 1
+ schema:
+ $ref: '#/components/schemas/ListKeyAssignmentsResponse'
+ description: List of key assignments
+ '401':
content:
application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
schema:
- $ref: '#/components/schemas/BadRequestResponse'
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List key assignments for a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: listGuardrailKeyAssignments
+ x-speakeasy-pagination:
+ inputs:
+ - in: parameters
+ name: offset
+ type: offset
+ - in: parameters
+ name: limit
+ type: limit
+ outputs:
+ results: $.data
+ type: offsetLimit
+ post:
+ description: >-
+ Assign multiple API keys to a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: bulkAssignKeysToGuardrail
+ parameters:
+ - description: The unique identifier of the guardrail
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ example:
+ key_hashes:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ schema:
+ $ref: '#/components/schemas/BulkAssignKeysRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ assigned_count: 3
+ schema:
+ $ref: '#/components/schemas/BulkAssignKeysResponse'
+ description: Assignment result
+ '400':
+ content:
+ application/json:
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '429':
- description: Too Many Requests - Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
content:
application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
example:
error:
- code: 429
- message: Rate limit exceeded
- '500':
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
description: Internal Server Error - Unexpected server error
+ summary: Bulk assign keys to a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: bulkAssignKeys
+ /guardrails/{id}/assignments/keys/remove:
+ post:
+ description: >-
+ Unassign multiple API keys from a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: bulkUnassignKeysFromGuardrail
+ parameters:
+ - description: The unique identifier of the guardrail
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ example:
+ key_hashes:
+ - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ schema:
+ $ref: '#/components/schemas/BulkUnassignKeysRequest'
+ required: true
+ responses:
+ '200':
content:
application/json:
+ example:
+ unassigned_count: 3
schema:
- $ref: '#/components/schemas/InternalServerResponse'
+ $ref: '#/components/schemas/BulkUnassignKeysResponse'
+ description: Unassignment result
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
+ content:
+ application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
example:
error:
code: 500
message: Internal Server Error
- operationId: updateKeys
- delete:
- x-speakeasy-name-override: delete
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Bulk unassign keys from a guardrail
tags:
- - API Keys
- summary: Delete an API key
- description: Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ - Guardrails
+ x-speakeasy-name-override: bulkUnassignKeys
+ /guardrails/{id}/assignments/members:
+ get:
+ description: >-
+ List all organization member assignments for a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: listGuardrailMemberAssignments
parameters:
- - schema:
- type: string
- description: The hash identifier of the API key to delete
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- required: true
- description: The hash identifier of the API key to delete
- name: hash
+ - description: The unique identifier of the guardrail
in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ - description: Number of records to skip for pagination
+ in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
+ in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
responses:
'200':
- description: API key deleted successfully
content:
application/json:
- schema:
- type: object
- properties:
- deleted:
- type: boolean
- const: true
- description: Confirmation that the API key was deleted
- example: true
- required:
- - deleted
- example:
- deleted: true
example:
- deleted: true
+ data:
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ organization_id: org_xyz789
+ user_id: user_abc123
+ total_count: 1
+ schema:
+ $ref: '#/components/schemas/ListMemberAssignmentsResponse'
+ description: List of member assignments
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '429':
- description: Too Many Requests - Rate limit exceeded
- content:
- application/json:
schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
- example:
- error:
- code: 429
- message: Rate limit exceeded
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- operationId: deleteKeys
- get:
- operationId: getKey
- x-speakeasy-name-override: get
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List member assignments for a guardrail
tags:
- - API Keys
- summary: Get a single API key
- description: Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ - Guardrails
+ x-speakeasy-name-override: listGuardrailMemberAssignments
+ x-speakeasy-pagination:
+ inputs:
+ - in: parameters
+ name: offset
+ type: offset
+ - in: parameters
+ name: limit
+ type: limit
+ outputs:
+ results: $.data
+ type: offsetLimit
+ post:
+ description: >-
+ Assign multiple organization members to a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: bulkAssignMembersToGuardrail
parameters:
- - schema:
- type: string
- description: The hash identifier of the API key to retrieve
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- required: true
- description: The hash identifier of the API key to retrieve
- name: hash
+ - description: The unique identifier of the guardrail
in: path
- responses:
- '200':
- description: API key details
- content:
- application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- hash:
- type: string
- description: Unique hash identifier for the API key
- example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name:
- type: string
- description: Name of the API key
- example: My Production Key
- label:
- type: string
- description: Human-readable label for the API key
- example: sk-or-v1-0e6...1c96
- disabled:
- type: boolean
- description: Whether the API key is disabled
- example: false
- limit:
- type: number
- format: double
- description: Spending limit for the API key in USD
- example: 100
- limit_remaining:
- type: number
- format: double
- description: Remaining spending limit in USD
- example: 74.5
- limit_reset:
- type: string
- nullable: true
- description: Type of limit reset for the API key
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include external BYOK usage in the credit limit
- example: false
- usage:
- type: number
- format: double
- description: Total OpenRouter credit usage (in USD) for the API key
- example: 25.5
- usage_daily:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC day
- example: 25.5
- usage_weekly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
- example: 25.5
- usage_monthly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC month
- example: 25.5
- byok_usage:
- type: number
- format: double
- description: Total external BYOK usage (in USD) for the API key
- example: 17.38
- byok_usage_daily:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC day
- example: 17.38
- byok_usage_weekly:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
- example: 17.38
- byok_usage_monthly:
- type: number
- format: double
- description: External BYOK usage (in USD) for current UTC month
- example: 17.38
- created_at:
- type: string
- description: ISO 8601 timestamp of when the API key was created
- example: '2025-08-24T10:30:00Z'
- updated_at:
- type: string
- nullable: true
- description: ISO 8601 timestamp of when the API key was last updated
- example: '2025-08-24T15:45:00Z'
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- description: >-
- The user ID of the key creator. For organization-owned keys, this is the member who created
- the key. For individual users, this is the user's own ID.
- example: user_2dHFtVWx2n56w6HkM0000000000
- required:
- - hash
- - name
- - label
- - disabled
- - limit
- - limit_remaining
- - limit_reset
- - include_byok_in_limit
- - usage
- - usage_daily
- - usage_weekly
- - usage_monthly
- - byok_usage
- - byok_usage_daily
- - byok_usage_weekly
- - byok_usage_monthly
- - created_at
- - updated_at
- - creator_user_id
- example:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: sk-or-v1-0e6...1c96
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- description: The API key information
- required:
- - data
- example:
- data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: Production API Key
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ example:
+ member_user_ids:
+ - user_abc123
+ - user_def456
+ schema:
+ $ref: '#/components/schemas/BulkAssignMembersRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
example:
- data:
- hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
- name: My Production Key
- label: Production API Key
- disabled: false
- limit: 100
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- '401':
- description: Unauthorized - Authentication required or invalid credentials
+ assigned_count: 2
+ schema:
+ $ref: '#/components/schemas/BulkAssignMembersResponse'
+ description: Assignment result
+ '400':
content:
application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
schema:
$ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Bulk assign members to a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: bulkAssignMembers
+ /guardrails/{id}/assignments/members/remove:
+ post:
+ description: >-
+ Unassign multiple organization members from a specific guardrail. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: bulkUnassignMembersFromGuardrail
+ parameters:
+ - description: The unique identifier of the guardrail
+ in: path
+ name: id
+ required: true
+ schema:
+ description: The unique identifier of the guardrail
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ example:
+ member_user_ids:
+ - user_abc123
+ - user_def456
+ schema:
+ $ref: '#/components/schemas/BulkUnassignMembersRequest'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ unassigned_count: 2
+ schema:
+ $ref: '#/components/schemas/BulkUnassignMembersResponse'
+ description: Unassignment result
+ '400':
+ content:
+ application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
+ content:
+ application/json:
example:
error:
code: 404
message: Resource not found
- '429':
- description: Too Many Requests - Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Bulk unassign members from a guardrail
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: bulkUnassignMembers
+ /guardrails/assignments/keys:
+ get:
+ description: >-
+ List all API key guardrail assignments for the authenticated user. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: listKeyAssignments
+ parameters:
+ - description: Number of records to skip for pagination
+ in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
+ in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ key_label: prod-key
+ key_name: Production Key
+ total_count: 1
+ schema:
+ $ref: '#/components/schemas/ListKeyAssignmentsResponse'
+ description: List of key assignments
+ '401':
+ content:
+ application/json:
+ example:
+ error:
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all key assignments
+ tags:
+ - Guardrails
+ x-speakeasy-name-override: listKeyAssignments
+ x-speakeasy-pagination:
+ inputs:
+ - in: parameters
+ name: offset
+ type: offset
+ - in: parameters
+ name: limit
+ type: limit
+ outputs:
+ results: $.data
+ type: offsetLimit
+ /guardrails/assignments/members:
+ get:
+ description: >-
+ List all organization member guardrail assignments for the authenticated user. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: listMemberAssignments
+ parameters:
+ - description: Number of records to skip for pagination
+ in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
+ in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - assigned_by: user_abc123
+ created_at: '2025-08-24T10:30:00Z'
+ guardrail_id: 550e8400-e29b-41d4-a716-446655440001
+ id: 550e8400-e29b-41d4-a716-446655440000
+ organization_id: org_xyz789
+ user_id: user_abc123
+ total_count: 1
+ schema:
+ $ref: '#/components/schemas/ListMemberAssignmentsResponse'
+ description: List of member assignments
+ '401':
content:
application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
example:
error:
- code: 429
- message: Rate limit exceeded
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- /organization/members:
- get:
- operationId: listOrganizationMembers
- x-speakeasy-name-override: listMembers
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all member assignments
tags:
- - Organization
- summary: List organization members
- description: >-
- List all members of the organization associated with the authenticated management key. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
+ - Guardrails
+ x-speakeasy-name-override: listMemberAssignments
x-speakeasy-pagination:
- type: offsetLimit
inputs:
- - name: offset
- in: parameters
+ - in: parameters
+ name: offset
type: offset
- - name: limit
- in: parameters
+ - in: parameters
+ name: limit
type: limit
outputs:
results: $.data
- parameters:
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
- in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
- required: false
- description: Maximum number of records to return (max 100)
- name: limit
- in: query
+ type: offsetLimit
+ /key:
+ get:
+ description: Get information on the API key associated with the current authentication session
+ operationId: getCurrentKey
responses:
'200':
- description: List of organization members
content:
application/json:
+ example:
+ data:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ expires_at: '2027-12-31T23:59:59Z'
+ include_byok_in_limit: false
+ is_free_tier: false
+ is_management_key: false
+ is_provisioning_key: false
+ label: sk-or-v1-au7...890
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ rate_limit:
+ interval: 1h
+ note: This field is deprecated and safe to ignore.
+ requests: 1000
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
schema:
- type: object
+ example:
+ data:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ expires_at: '2027-12-31T23:59:59Z'
+ include_byok_in_limit: false
+ is_free_tier: false
+ is_management_key: false
+ is_provisioning_key: false
+ label: sk-or-v1-au7...890
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ rate_limit:
+ interval: 1h
+ note: This field is deprecated and safe to ignore.
+ requests: 1000
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
properties:
data:
- type: array
- items:
- type: object
- properties:
- id:
- type: string
- description: User ID of the organization member
- example: user_2dHFtVWx2n56w6HkM0000000000
- first_name:
- type: string
- nullable: true
- description: First name of the member
- example: Jane
- last_name:
- type: string
- nullable: true
- description: Last name of the member
- example: Doe
- email:
- type: string
- description: Email address of the member
- example: jane.doe@example.com
- role:
- type: string
- enum:
- - org:admin
- - org:member
- description: Role of the member in the organization
- example: org:member
- required:
- - id
- - first_name
- - last_name
- - email
- - role
- description: List of organization members
- total_count:
- type: integer
- description: Total number of members in the organization
- example: 25
+ description: Current API key information
+ example:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ expires_at: '2027-12-31T23:59:59Z'
+ include_byok_in_limit: false
+ is_free_tier: false
+ is_management_key: false
+ is_provisioning_key: false
+ label: sk-or-v1-au7...890
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ rate_limit:
+ interval: 1h
+ note: This field is deprecated and safe to ignore.
+ requests: 1000
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ byok_usage:
+ description: Total external BYOK usage (in USD) for the API key
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_daily:
+ description: External BYOK usage (in USD) for the current UTC day
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_monthly:
+ description: External BYOK usage (in USD) for current UTC month
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_weekly:
+ description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 17.38
+ format: double
+ type: number
+ creator_user_id:
+ description: >-
+ The user ID of the key creator. For organization-owned keys, this is the member who created
+ the key. For individual users, this is the user's own ID.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ nullable: true
+ type: string
+ expires_at:
+ description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ include_byok_in_limit:
+ description: Whether to include external BYOK usage in the credit limit
+ example: false
+ type: boolean
+ is_free_tier:
+ description: Whether this is a free tier API key
+ example: false
+ type: boolean
+ is_management_key:
+ description: Whether this is a management key
+ example: false
+ type: boolean
+ is_provisioning_key:
+ deprecated: true
+ description: Whether this is a management key
+ example: false
+ type: boolean
+ label:
+ description: Human-readable label for the API key
+ example: sk-or-v1-0e6...1c96
+ type: string
+ limit:
+ description: Spending limit for the API key in USD
+ example: 100
+ format: double
+ type: number
+ limit_remaining:
+ description: Remaining spending limit in USD
+ example: 74.5
+ format: double
+ type: number
+ limit_reset:
+ description: Type of limit reset for the API key
+ example: monthly
+ nullable: true
+ type: string
+ rate_limit:
+ deprecated: true
+ description: Legacy rate limit information about a key. Will always return -1.
+ example:
+ interval: 1h
+ note: This field is deprecated and safe to ignore.
+ requests: 1000
+ properties:
+ interval:
+ description: Rate limit interval
+ example: 1h
+ type: string
+ note:
+ description: Note about the rate limit
+ example: This field is deprecated and safe to ignore.
+ type: string
+ requests:
+ description: Number of requests allowed per interval
+ example: 1000
+ type: integer
+ required:
+ - requests
+ - interval
+ - note
+ type: object
+ usage:
+ description: Total OpenRouter credit usage (in USD) for the API key
+ example: 25.5
+ format: double
+ type: number
+ usage_daily:
+ description: OpenRouter credit usage (in USD) for the current UTC day
+ example: 25.5
+ format: double
+ type: number
+ usage_monthly:
+ description: OpenRouter credit usage (in USD) for the current UTC month
+ example: 25.5
+ format: double
+ type: number
+ usage_weekly:
+ description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 25.5
+ format: double
+ type: number
+ required:
+ - label
+ - limit
+ - usage
+ - usage_daily
+ - usage_weekly
+ - usage_monthly
+ - byok_usage
+ - byok_usage_daily
+ - byok_usage_weekly
+ - byok_usage_monthly
+ - is_free_tier
+ - is_management_key
+ - is_provisioning_key
+ - limit_remaining
+ - limit_reset
+ - include_byok_in_limit
+ - creator_user_id
+ - rate_limit
+ type: object
required:
- data
- - total_count
- example:
- data:
- - id: user_2dHFtVWx2n56w6HkM0000000000
- first_name: Jane
- last_name: Doe
- email: jane.doe@example.com
- role: member
- total_count: 25
+ type: object
+ description: API key details
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- /guardrails:
- get:
- operationId: listGuardrails
- x-speakeasy-name-override: list
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get current API key
tags:
- - Guardrails
- summary: List guardrails
+ - API Keys
+ x-speakeasy-name-override: getCurrentKeyMetadata
+ /keys:
+ get:
description: >-
- List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys)
+ List all API keys for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys)
required.
- x-speakeasy-pagination:
- type: offsetLimit
- inputs:
- - name: offset
- in: parameters
- type: offset
- - name: limit
- in: parameters
- type: limit
- outputs:
- results: $.data
+ operationId: list
parameters:
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
+ - description: Whether to include disabled API keys in the response
in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
+ name: include_disabled
required: false
- description: Maximum number of records to return (max 100)
- name: limit
+ schema:
+ description: Whether to include disabled API keys in the response
+ example: 'false'
+ type: string
+ x-openrouter-type: boolean
+ - description: Number of API keys to skip for pagination
in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of API keys to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
responses:
'200':
- description: List of guardrails
content:
application/json:
- schema:
- $ref: '#/components/schemas/ListGuardrailsResponse'
example:
data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- name: Production Guardrail
- description: Guardrail for production environment
- limit_usd: 100
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
+ - byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: Production API Key
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
updated_at: '2025-08-24T15:45:00Z'
- total_count: 1
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ schema:
+ example:
+ data:
+ - byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: Production API Key
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ data:
+ description: List of API keys
+ items:
+ example:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: sk-or-v1-0e6...1c96
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ byok_usage:
+ description: Total external BYOK usage (in USD) for the API key
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_daily:
+ description: External BYOK usage (in USD) for the current UTC day
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_monthly:
+ description: External BYOK usage (in USD) for current UTC month
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_weekly:
+ description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 17.38
+ format: double
+ type: number
+ created_at:
+ description: ISO 8601 timestamp of when the API key was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ creator_user_id:
+ description: >-
+ The user ID of the key creator. For organization-owned keys, this is the member who created
+ the key. For individual users, this is the user's own ID.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ nullable: true
+ type: string
+ disabled:
+ description: Whether the API key is disabled
+ example: false
+ type: boolean
+ expires_at:
+ description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ hash:
+ description: Unique hash identifier for the API key
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
+ include_byok_in_limit:
+ description: Whether to include external BYOK usage in the credit limit
+ example: false
+ type: boolean
+ label:
+ description: Human-readable label for the API key
+ example: sk-or-v1-0e6...1c96
+ type: string
+ limit:
+ description: Spending limit for the API key in USD
+ example: 100
+ format: double
+ type: number
+ limit_remaining:
+ description: Remaining spending limit in USD
+ example: 74.5
+ format: double
+ type: number
+ limit_reset:
+ description: Type of limit reset for the API key
+ example: monthly
+ nullable: true
+ type: string
+ name:
+ description: Name of the API key
+ example: My Production Key
+ type: string
+ updated_at:
+ description: ISO 8601 timestamp of when the API key was last updated
+ example: '2025-08-24T15:45:00Z'
+ nullable: true
+ type: string
+ usage:
+ description: Total OpenRouter credit usage (in USD) for the API key
+ example: 25.5
+ format: double
+ type: number
+ usage_daily:
+ description: OpenRouter credit usage (in USD) for the current UTC day
+ example: 25.5
+ format: double
+ type: number
+ usage_monthly:
+ description: OpenRouter credit usage (in USD) for the current UTC month
+ example: 25.5
+ format: double
+ type: number
+ usage_weekly:
+ description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 25.5
+ format: double
+ type: number
+ required:
+ - hash
+ - name
+ - label
+ - disabled
+ - limit
+ - limit_remaining
+ - limit_reset
+ - include_byok_in_limit
+ - usage
+ - usage_daily
+ - usage_weekly
+ - usage_monthly
+ - byok_usage
+ - byok_usage_daily
+ - byok_usage_weekly
+ - byok_usage_monthly
+ - created_at
+ - updated_at
+ - creator_user_id
+ type: object
+ type: array
+ required:
+ - data
+ type: object
+ description: List of API keys
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- post:
- operationId: createGuardrail
- x-speakeasy-name-override: create
- tags:
- - Guardrails
- summary: Create a guardrail
- description: >-
- Create a new guardrail for the authenticated user. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateGuardrailRequest'
- example:
- name: My New Guardrail
- description: A guardrail for limiting API usage
- limit_usd: 50
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - deepseek
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- required: true
- responses:
- '201':
- description: Guardrail created successfully
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/CreateGuardrailResponse'
- example:
- data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: My New Guardrail
- description: A guardrail for limiting API usage
- limit_usd: 50
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: null
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
schema:
$ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /guardrails/{id}:
- get:
- operationId: getGuardrail
- x-speakeasy-name-override: get
- tags:
- - Guardrails
- summary: Get a guardrail
- description: Get a single guardrail by ID. [Management key](/docs/guides/overview/auth/management-api-keys) required.
- parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail to retrieve
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail to retrieve
- name: id
- in: path
- responses:
- '200':
- description: Guardrail details
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/GetGuardrailResponse'
- example:
- data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: Production Guardrail
- description: Guardrail for production environment
- limit_usd: 100
- reset_interval: monthly
- allowed_providers:
- - openai
- - anthropic
- - google
- ignored_providers: null
- allowed_models: null
- enforce_zdr: false
- created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T15:45:00Z'
- '401':
description: Unauthorized - Authentication required or invalid credentials
+ '429':
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
- code: 401
- message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
+ code: 429
+ message: Rate limit exceeded
schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- patch:
- operationId: updateGuardrail
- x-speakeasy-name-override: update
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List API keys
tags:
- - Guardrails
- summary: Update a guardrail
- description: Update an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
- parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail to update
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail to update
- name: id
- in: path
+ - API Keys
+ x-speakeasy-name-override: list
+ post:
+ description: >-
+ Create a new API key for the authenticated user. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: createKeys
requestBody:
content:
application/json:
- schema:
- $ref: '#/components/schemas/UpdateGuardrailRequest'
example:
- name: Updated Guardrail Name
- description: Updated description
- limit_usd: 75
- reset_interval: weekly
+ expires_at: '2027-12-31T23:59:59Z'
+ include_byok_in_limit: true
+ limit: 50
+ limit_reset: monthly
+ name: My New API Key
+ schema:
+ example:
+ expires_at: '2027-12-31T23:59:59Z'
+ include_byok_in_limit: true
+ limit: 50
+ limit_reset: monthly
+ name: My New API Key
+ properties:
+ creator_user_id:
+ description: >-
+ Optional user ID of the key creator. Only meaningful for organization-owned keys where a specific
+ member is creating the key.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ minLength: 1
+ nullable: true
+ type: string
+ expires_at:
+ description: >-
+ Optional ISO 8601 UTC timestamp when the API key should expire. Must be UTC, other timezones will be
+ rejected
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ include_byok_in_limit:
+ description: Whether to include BYOK usage in the limit
+ example: true
+ type: boolean
+ limit:
+ description: Optional spending limit for the API key in USD
+ example: 50
+ format: double
+ type: number
+ limit_reset:
+ description: >-
+ Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen
+ automatically at midnight UTC, and weeks are Monday through Sunday.
+ enum:
+ - daily
+ - weekly
+ - monthly
+ - null
+ example: monthly
+ nullable: true
+ type: string
+ name:
+ description: Name for the new API key
+ example: My New API Key
+ minLength: 1
+ type: string
+ required:
+ - name
+ type: object
required: true
responses:
- '200':
- description: Guardrail updated successfully
+ '201':
content:
application/json:
- schema:
- $ref: '#/components/schemas/UpdateGuardrailResponse'
example:
data:
- id: 550e8400-e29b-41d4-a716-446655440000
- name: Updated Guardrail Name
- description: Updated description
- limit_usd: 75
- reset_interval: weekly
- allowed_providers:
- - openai
- ignored_providers: null
- allowed_models: null
- enforce_zdr: true
+ byok_usage: 0
+ byok_usage_daily: 0
+ byok_usage_monthly: 0
+ byok_usage_weekly: 0
created_at: '2025-08-24T10:30:00Z'
- updated_at: '2025-08-24T16:00:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: true
+ label: My New API Key
+ limit: 50
+ limit_remaining: 50
+ limit_reset: monthly
+ name: My New API Key
+ updated_at: null
+ usage: 0
+ usage_daily: 0
+ usage_monthly: 0
+ usage_weekly: 0
+ key: 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
+ schema:
+ example:
+ data:
+ byok_usage: 0
+ byok_usage_daily: 0
+ byok_usage_monthly: 0
+ byok_usage_weekly: 0
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: true
+ label: My New API Key
+ limit: 50
+ limit_remaining: 50
+ limit_reset: monthly
+ name: My New API Key
+ updated_at: null
+ usage: 0
+ usage_daily: 0
+ usage_monthly: 0
+ usage_weekly: 0
+ key: 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
+ properties:
+ data:
+ description: The created API key information
+ example:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: sk-or-v1-0e6...1c96
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ byok_usage:
+ description: Total external BYOK usage (in USD) for the API key
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_daily:
+ description: External BYOK usage (in USD) for the current UTC day
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_monthly:
+ description: External BYOK usage (in USD) for current UTC month
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_weekly:
+ description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 17.38
+ format: double
+ type: number
+ created_at:
+ description: ISO 8601 timestamp of when the API key was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ creator_user_id:
+ description: >-
+ The user ID of the key creator. For organization-owned keys, this is the member who created
+ the key. For individual users, this is the user's own ID.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ nullable: true
+ type: string
+ disabled:
+ description: Whether the API key is disabled
+ example: false
+ type: boolean
+ expires_at:
+ description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ hash:
+ description: Unique hash identifier for the API key
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
+ include_byok_in_limit:
+ description: Whether to include external BYOK usage in the credit limit
+ example: false
+ type: boolean
+ label:
+ description: Human-readable label for the API key
+ example: sk-or-v1-0e6...1c96
+ type: string
+ limit:
+ description: Spending limit for the API key in USD
+ example: 100
+ format: double
+ type: number
+ limit_remaining:
+ description: Remaining spending limit in USD
+ example: 74.5
+ format: double
+ type: number
+ limit_reset:
+ description: Type of limit reset for the API key
+ example: monthly
+ nullable: true
+ type: string
+ name:
+ description: Name of the API key
+ example: My Production Key
+ type: string
+ updated_at:
+ description: ISO 8601 timestamp of when the API key was last updated
+ example: '2025-08-24T15:45:00Z'
+ nullable: true
+ type: string
+ usage:
+ description: Total OpenRouter credit usage (in USD) for the API key
+ example: 25.5
+ format: double
+ type: number
+ usage_daily:
+ description: OpenRouter credit usage (in USD) for the current UTC day
+ example: 25.5
+ format: double
+ type: number
+ usage_monthly:
+ description: OpenRouter credit usage (in USD) for the current UTC month
+ example: 25.5
+ format: double
+ type: number
+ usage_weekly:
+ description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 25.5
+ format: double
+ type: number
+ required:
+ - hash
+ - name
+ - label
+ - disabled
+ - limit
+ - limit_remaining
+ - limit_reset
+ - include_byok_in_limit
+ - usage
+ - usage_daily
+ - usage_weekly
+ - usage_monthly
+ - byok_usage
+ - byok_usage_daily
+ - byok_usage_weekly
+ - byok_usage_monthly
+ - created_at
+ - updated_at
+ - creator_user_id
+ type: object
+ key:
+ description: The actual API key string (only shown once)
+ example: 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
+ type: string
+ required:
+ - data
+ - key
+ type: object
+ description: API key created successfully
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '429':
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
- code: 404
- message: Resource not found
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- delete:
- operationId: deleteGuardrail
- x-speakeasy-name-override: delete
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Create a new API key
tags:
- - Guardrails
- summary: Delete a guardrail
- description: Delete an existing guardrail. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ - API Keys
+ x-speakeasy-name-override: create
+ /keys/{hash}:
+ delete:
+ description: Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: deleteKeys
parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail to delete
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail to delete
- name: id
+ - description: The hash identifier of the API key to delete
in: path
+ name: hash
+ required: true
+ schema:
+ description: The hash identifier of the API key to delete
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
responses:
'200':
- description: Guardrail deleted successfully
content:
application/json:
- schema:
- $ref: '#/components/schemas/DeleteGuardrailResponse'
example:
deleted: true
+ schema:
+ example:
+ deleted: true
+ properties:
+ deleted:
+ const: true
+ description: Confirmation that the API key was deleted
+ example: true
+ type: boolean
+ required:
+ - deleted
+ type: object
+ description: API key deleted successfully
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /guardrails/assignments/keys:
- get:
- operationId: listKeyAssignments
- x-speakeasy-name-override: listKeyAssignments
- tags:
- - Guardrails
- summary: List all key assignments
- description: >-
- List all API key guardrail assignments for the authenticated user. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- x-speakeasy-pagination:
- type: offsetLimit
- inputs:
- - name: offset
- in: parameters
- type: offset
- - name: limit
- in: parameters
- type: limit
- outputs:
- results: $.data
- parameters:
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
- in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
- required: false
- description: Maximum number of records to return (max 100)
- name: limit
- in: query
- responses:
- '200':
- description: List of key assignments
- content:
- application/json:
schema:
- $ref: '#/components/schemas/ListKeyAssignmentsResponse'
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- key_name: Production Key
- key_label: prod-key
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- total_count: 1
- '401':
- description: Unauthorized - Authentication required or invalid credentials
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '429':
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
- code: 401
- message: Missing Authentication header
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- /guardrails/assignments/members:
- get:
- operationId: listMemberAssignments
- x-speakeasy-name-override: listMemberAssignments
- tags:
- - Guardrails
- summary: List all member assignments
- description: >-
- List all organization member guardrail assignments for the authenticated user. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- x-speakeasy-pagination:
- type: offsetLimit
- inputs:
- - name: offset
- in: parameters
- type: offset
- - name: limit
- in: parameters
- type: limit
- outputs:
- results: $.data
- parameters:
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
- in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
- required: false
- description: Maximum number of records to return (max 100)
- name: limit
- in: query
- responses:
- '200':
- description: List of member assignments
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListMemberAssignmentsResponse'
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- user_id: user_abc123
- organization_id: org_xyz789
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- total_count: 1
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
schema:
$ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /guardrails/{id}/assignments/keys:
- get:
- operationId: listGuardrailKeyAssignments
- x-speakeasy-name-override: listGuardrailKeyAssignments
+ description: Internal Server Error - Unexpected server error
+ summary: Delete an API key
tags:
- - Guardrails
- summary: List key assignments for a guardrail
- description: >-
- List all API key assignments for a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- x-speakeasy-pagination:
- type: offsetLimit
- inputs:
- - name: offset
- in: parameters
- type: offset
- - name: limit
- in: parameters
- type: limit
- outputs:
- results: $.data
+ - API Keys
+ x-speakeasy-name-override: delete
+ get:
+ description: Get a single API key by hash. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: getKey
parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
+ - description: The hash identifier of the API key to retrieve
in: path
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
- in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
- required: false
- description: Maximum number of records to return (max 100)
- name: limit
- in: query
+ name: hash
+ required: true
+ schema:
+ description: The hash identifier of the API key to retrieve
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
responses:
'200':
- description: List of key assignments
content:
application/json:
- schema:
- $ref: '#/components/schemas/ListKeyAssignmentsResponse'
example:
data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- key_hash: c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- key_name: Production Key
- key_label: prod-key
- assigned_by: user_abc123
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: Production API Key
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ schema:
+ example:
+ data:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
created_at: '2025-08-24T10:30:00Z'
- total_count: 1
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: Production API Key
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ data:
+ description: The API key information
+ example:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: sk-or-v1-0e6...1c96
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ byok_usage:
+ description: Total external BYOK usage (in USD) for the API key
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_daily:
+ description: External BYOK usage (in USD) for the current UTC day
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_monthly:
+ description: External BYOK usage (in USD) for current UTC month
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_weekly:
+ description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 17.38
+ format: double
+ type: number
+ created_at:
+ description: ISO 8601 timestamp of when the API key was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ creator_user_id:
+ description: >-
+ The user ID of the key creator. For organization-owned keys, this is the member who created
+ the key. For individual users, this is the user's own ID.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ nullable: true
+ type: string
+ disabled:
+ description: Whether the API key is disabled
+ example: false
+ type: boolean
+ expires_at:
+ description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ hash:
+ description: Unique hash identifier for the API key
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
+ include_byok_in_limit:
+ description: Whether to include external BYOK usage in the credit limit
+ example: false
+ type: boolean
+ label:
+ description: Human-readable label for the API key
+ example: sk-or-v1-0e6...1c96
+ type: string
+ limit:
+ description: Spending limit for the API key in USD
+ example: 100
+ format: double
+ type: number
+ limit_remaining:
+ description: Remaining spending limit in USD
+ example: 74.5
+ format: double
+ type: number
+ limit_reset:
+ description: Type of limit reset for the API key
+ example: monthly
+ nullable: true
+ type: string
+ name:
+ description: Name of the API key
+ example: My Production Key
+ type: string
+ updated_at:
+ description: ISO 8601 timestamp of when the API key was last updated
+ example: '2025-08-24T15:45:00Z'
+ nullable: true
+ type: string
+ usage:
+ description: Total OpenRouter credit usage (in USD) for the API key
+ example: 25.5
+ format: double
+ type: number
+ usage_daily:
+ description: OpenRouter credit usage (in USD) for the current UTC day
+ example: 25.5
+ format: double
+ type: number
+ usage_monthly:
+ description: OpenRouter credit usage (in USD) for the current UTC month
+ example: 25.5
+ format: double
+ type: number
+ usage_weekly:
+ description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 25.5
+ format: double
+ type: number
+ required:
+ - hash
+ - name
+ - label
+ - disabled
+ - limit
+ - limit_remaining
+ - limit_reset
+ - include_byok_in_limit
+ - usage
+ - usage_daily
+ - usage_weekly
+ - usage_monthly
+ - byok_usage
+ - byok_usage_daily
+ - byok_usage_weekly
+ - byok_usage_monthly
+ - created_at
+ - updated_at
+ - creator_user_id
+ type: object
+ required:
+ - data
+ type: object
+ description: API key details
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '429':
content:
application/json:
+ example:
+ error:
+ code: 429
+ message: Rate limit exceeded
schema:
- $ref: '#/components/schemas/InternalServerResponse'
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
+ '500':
+ content:
+ application/json:
example:
error:
code: 500
message: Internal Server Error
- post:
- operationId: bulkAssignKeysToGuardrail
- x-speakeasy-name-override: bulkAssignKeys
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get a single API key
tags:
- - Guardrails
- summary: Bulk assign keys to a guardrail
- description: >-
- Assign multiple API keys to a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
+ - API Keys
+ x-speakeasy-name-override: get
+ patch:
+ description: Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: updateKeys
parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
+ - description: The hash identifier of the API key to update
in: path
+ name: hash
+ required: true
+ schema:
+ description: The hash identifier of the API key to update
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
requestBody:
content:
application/json:
- schema:
- $ref: '#/components/schemas/BulkAssignKeysRequest'
example:
- key_hashes:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
+ disabled: false
+ include_byok_in_limit: true
+ limit: 75
+ limit_reset: daily
+ name: Updated API Key Name
+ schema:
+ example:
+ disabled: false
+ include_byok_in_limit: true
+ limit: 75
+ limit_reset: daily
+ name: Updated API Key Name
+ properties:
+ disabled:
+ description: Whether to disable the API key
+ example: false
+ type: boolean
+ include_byok_in_limit:
+ description: Whether to include BYOK usage in the limit
+ example: true
+ type: boolean
+ limit:
+ description: New spending limit for the API key in USD
+ example: 75
+ format: double
+ type: number
+ limit_reset:
+ description: >-
+ New limit reset type for the API key (daily, weekly, monthly, or null for no reset). Resets happen
+ automatically at midnight UTC, and weeks are Monday through Sunday.
+ enum:
+ - daily
+ - weekly
+ - monthly
+ - null
+ example: daily
+ nullable: true
+ type: string
+ name:
+ description: New name for the API key
+ example: Updated API Key Name
+ type: string
+ type: object
required: true
responses:
'200':
- description: Assignment result
content:
application/json:
- schema:
- $ref: '#/components/schemas/BulkAssignKeysResponse'
example:
- assigned_count: 3
+ data:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: null
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: true
+ label: Updated API Key Name
+ limit: 75
+ limit_remaining: 49.5
+ limit_reset: daily
+ name: Updated API Key Name
+ updated_at: '2025-08-24T16:00:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ schema:
+ example:
+ data:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: null
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: true
+ label: Updated API Key Name
+ limit: 75
+ limit_remaining: 49.5
+ limit_reset: daily
+ name: Updated API Key Name
+ updated_at: '2025-08-24T16:00:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ data:
+ description: The updated API key information
+ example:
+ byok_usage: 17.38
+ byok_usage_daily: 17.38
+ byok_usage_monthly: 17.38
+ byok_usage_weekly: 17.38
+ created_at: '2025-08-24T10:30:00Z'
+ creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
+ disabled: false
+ expires_at: '2027-12-31T23:59:59Z'
+ hash: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ include_byok_in_limit: false
+ label: sk-or-v1-0e6...1c96
+ limit: 100
+ limit_remaining: 74.5
+ limit_reset: monthly
+ name: My Production Key
+ updated_at: '2025-08-24T15:45:00Z'
+ usage: 25.5
+ usage_daily: 25.5
+ usage_monthly: 25.5
+ usage_weekly: 25.5
+ properties:
+ byok_usage:
+ description: Total external BYOK usage (in USD) for the API key
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_daily:
+ description: External BYOK usage (in USD) for the current UTC day
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_monthly:
+ description: External BYOK usage (in USD) for current UTC month
+ example: 17.38
+ format: double
+ type: number
+ byok_usage_weekly:
+ description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 17.38
+ format: double
+ type: number
+ created_at:
+ description: ISO 8601 timestamp of when the API key was created
+ example: '2025-08-24T10:30:00Z'
+ type: string
+ creator_user_id:
+ description: >-
+ The user ID of the key creator. For organization-owned keys, this is the member who created
+ the key. For individual users, this is the user's own ID.
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ nullable: true
+ type: string
+ disabled:
+ description: Whether the API key is disabled
+ example: false
+ type: boolean
+ expires_at:
+ description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
+ example: '2027-12-31T23:59:59Z'
+ format: date-time
+ nullable: true
+ type: string
+ hash:
+ description: Unique hash identifier for the API key
+ example: f01d52606dc8f0a8303a7b5cc3fa07109c2e346cec7c0a16b40de462992ce943
+ type: string
+ include_byok_in_limit:
+ description: Whether to include external BYOK usage in the credit limit
+ example: false
+ type: boolean
+ label:
+ description: Human-readable label for the API key
+ example: sk-or-v1-0e6...1c96
+ type: string
+ limit:
+ description: Spending limit for the API key in USD
+ example: 100
+ format: double
+ type: number
+ limit_remaining:
+ description: Remaining spending limit in USD
+ example: 74.5
+ format: double
+ type: number
+ limit_reset:
+ description: Type of limit reset for the API key
+ example: monthly
+ nullable: true
+ type: string
+ name:
+ description: Name of the API key
+ example: My Production Key
+ type: string
+ updated_at:
+ description: ISO 8601 timestamp of when the API key was last updated
+ example: '2025-08-24T15:45:00Z'
+ nullable: true
+ type: string
+ usage:
+ description: Total OpenRouter credit usage (in USD) for the API key
+ example: 25.5
+ format: double
+ type: number
+ usage_daily:
+ description: OpenRouter credit usage (in USD) for the current UTC day
+ example: 25.5
+ format: double
+ type: number
+ usage_monthly:
+ description: OpenRouter credit usage (in USD) for the current UTC month
+ example: 25.5
+ format: double
+ type: number
+ usage_weekly:
+ description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
+ example: 25.5
+ format: double
+ type: number
+ required:
+ - hash
+ - name
+ - label
+ - disabled
+ - limit
+ - limit_remaining
+ - limit_reset
+ - include_byok_in_limit
+ - usage
+ - usage_daily
+ - usage_weekly
+ - usage_monthly
+ - byok_usage
+ - byok_usage_daily
+ - byok_usage_weekly
+ - byok_usage_monthly
+ - created_at
+ - updated_at
+ - creator_user_id
+ type: object
+ required:
+ - data
+ type: object
+ description: API key updated successfully
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- /guardrails/{id}/assignments/members:
- get:
- operationId: listGuardrailMemberAssignments
- x-speakeasy-name-override: listGuardrailMemberAssignments
- tags:
- - Guardrails
- summary: List member assignments for a guardrail
- description: >-
- List all organization member assignments for a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- x-speakeasy-pagination:
- type: offsetLimit
- inputs:
- - name: offset
- in: parameters
- type: offset
- - name: limit
- in: parameters
- type: limit
- outputs:
- results: $.data
- parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
- in: path
- - schema:
- type: integer
- minimum: 0
- description: Number of records to skip for pagination
- example: 0
- required: false
- description: Number of records to skip for pagination
- name: offset
- in: query
- - schema:
- type: integer
- minimum: 1
- maximum: 100
- description: Maximum number of records to return (max 100)
- example: 50
- required: false
- description: Maximum number of records to return (max 100)
- name: limit
- in: query
- responses:
- '200':
- description: List of member assignments
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ListMemberAssignmentsResponse'
- example:
- data:
- - id: 550e8400-e29b-41d4-a716-446655440000
- user_id: user_abc123
- organization_id: org_xyz789
- guardrail_id: 550e8400-e29b-41d4-a716-446655440001
- assigned_by: user_abc123
- created_at: '2025-08-24T10:30:00Z'
- total_count: 1
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '404':
+ $ref: '#/components/schemas/NotFoundResponse'
description: Not Found - Resource does not exist
+ '429':
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
- code: 404
- message: Resource not found
+ code: 429
+ message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- post:
- operationId: bulkAssignMembersToGuardrail
- x-speakeasy-name-override: bulkAssignMembers
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Update an API key
tags:
- - Guardrails
- summary: Bulk assign members to a guardrail
+ - API Keys
+ x-speakeasy-name-override: update
+ /messages:
+ post:
description: >-
- Assign multiple organization members to a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
- in: path
+ Creates a message using the Anthropic Messages API format. Supports text, images, PDFs, tools, and extended
+ thinking.
+ operationId: createMessages
requestBody:
content:
application/json:
- schema:
- $ref: '#/components/schemas/BulkAssignMembersRequest'
example:
- member_user_ids:
- - user_abc123
- - user_def456
+ max_tokens: 1024
+ messages:
+ - content: Hello, how are you?
+ role: user
+ model: anthropic/claude-sonnet-4
+ schema:
+ $ref: '#/components/schemas/MessagesRequest'
required: true
responses:
'200':
- description: Assignment result
content:
application/json:
+ example:
+ content:
+ - text: I'm doing well, thank you for asking! How can I help you today?
+ type: text
+ id: msg_abc123
+ model: anthropic/claude-sonnet-4
+ role: assistant
+ stop_reason: end_turn
+ type: message
+ usage:
+ input_tokens: 12
+ output_tokens: 18
schema:
- $ref: '#/components/schemas/BulkAssignMembersResponse'
+ $ref: '#/components/schemas/MessagesResult'
+ text/event-stream:
example:
- assigned_count: 2
+ data:
+ delta:
+ text: Hello
+ type: text_delta
+ index: 0
+ type: content_block_delta
+ event: content_block_delta
+ schema:
+ properties:
+ data:
+ $ref: '#/components/schemas/MessagesStreamEvents'
+ event:
+ type: string
+ required:
+ - event
+ - data
+ type: object
+ x-speakeasy-sse-sentinel: '[DONE]'
+ description: Successful response
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
- code: 400
- message: Invalid request parameters
+ message: 'Invalid request: messages is required'
+ type: invalid_request_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Invalid request error
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
- code: 401
- message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
- content:
- application/json:
+ message: Invalid API key
+ type: authentication_error
+ type: error
schema:
- $ref: '#/components/schemas/NotFoundResponse'
- example:
- error:
- code: 404
- message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Authentication error
+ '403':
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
- code: 500
- message: Internal Server Error
- /guardrails/{id}/assignments/keys/remove:
- post:
- operationId: bulkUnassignKeysFromGuardrail
- x-speakeasy-name-override: bulkUnassignKeys
- tags:
- - Guardrails
- summary: Bulk unassign keys from a guardrail
- description: >-
- Unassign multiple API keys from a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
- parameters:
- - schema:
- type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
- in: path
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BulkUnassignKeysRequest'
- example:
- key_hashes:
- - c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
- required: true
- responses:
- '200':
- description: Unassignment result
+ message: Permission denied
+ type: permission_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Permission denied error
+ '404':
content:
application/json:
- schema:
- $ref: '#/components/schemas/BulkUnassignKeysResponse'
example:
- unassigned_count: 3
- '400':
- description: Bad Request - Invalid request parameters or malformed input
+ error:
+ message: Model not found
+ type: not_found_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Not found error
+ '429':
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
+ message: Rate limit exceeded
+ type: rate_limit_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Rate limit error
+ '500':
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
- code: 401
- message: Missing Authentication header
- '404':
- description: Not Found - Resource does not exist
+ message: Internal server error
+ type: api_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: API error
+ '503':
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
- code: 404
- message: Resource not found
- '500':
- description: Internal Server Error - Unexpected server error
+ message: Service temporarily overloaded
+ type: overloaded_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Overloaded error
+ '529':
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
- code: 500
- message: Internal Server Error
- /guardrails/{id}/assignments/members/remove:
- post:
- operationId: bulkUnassignMembersFromGuardrail
- x-speakeasy-name-override: bulkUnassignMembers
+ message: Provider is temporarily overloaded
+ type: overloaded_error
+ type: error
+ schema:
+ $ref: '#/components/schemas/MessagesErrorResponse'
+ description: Overloaded error
+ summary: Create a message
tags:
- - Guardrails
- summary: Bulk unassign members from a guardrail
- description: >-
- Unassign multiple organization members from a specific guardrail. [Management
- key](/docs/guides/overview/auth/management-api-keys) required.
+ - Anthropic Messages
+ x-speakeasy-ignore: true
+ x-speakeasy-name-override: create
+ x-speakeasy-stream-request-field: stream
+ /models:
+ get:
+ operationId: getModels
parameters:
- - schema:
+ - description: Filter models by use case category
+ in: query
+ name: category
+ required: false
+ schema:
+ description: Filter models by use case category
+ enum:
+ - programming
+ - roleplay
+ - marketing
+ - marketing/seo
+ - technology
+ - science
+ - translation
+ - legal
+ - finance
+ - health
+ - trivia
+ - academia
+ example: programming
+ type: string
+ - description: Filter models by supported parameter (comma-separated)
+ in: query
+ name: supported_parameters
+ required: false
+ schema:
+ description: Filter models by supported parameter (comma-separated)
+ example: temperature
+ type: string
+ - description: >-
+ Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
+ embeddings) or "all" to include all models. Defaults to "text".
+ in: query
+ name: output_modalities
+ required: false
+ schema:
+ description: >-
+ Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
+ embeddings) or "all" to include all models. Defaults to "text".
+ example: text
+ type: string
+ - description: Return results as RSS feed
+ in: query
+ name: use_rss
+ required: false
+ schema:
+ description: Return results as RSS feed
+ example: 'true'
+ type: string
+ - description: Use chat links in RSS feed items
+ in: query
+ name: use_rss_chat_links
+ required: false
+ schema:
+ description: Use chat links in RSS feed items
+ example: 'true'
type: string
- format: uuid
- description: The unique identifier of the guardrail
- example: 550e8400-e29b-41d4-a716-446655440000
- required: true
- description: The unique identifier of the guardrail
- name: id
- in: path
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BulkUnassignMembersRequest'
- example:
- member_user_ids:
- - user_abc123
- - user_def456
- required: true
responses:
'200':
- description: Unassignment result
content:
application/json:
- schema:
- $ref: '#/components/schemas/BulkUnassignMembersResponse'
example:
- unassigned_count: 2
+ data:
+ - architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ canonical_slug: openai/gpt-4
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ expiration_date: null
+ id: openai/gpt-4
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
+ name: GPT-4
+ per_request_limits: null
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ top_provider:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
+ schema:
+ $ref: '#/components/schemas/ModelsListResponse'
+ application/rss+xml:
+ example: >-
+ OpenRouter
+ Models
+ schema:
+ type: string
+ description: Returns a list of models or RSS feed
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '500':
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
- code: 401
- message: Missing Authentication header
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all models and their properties
+ tags:
+ - Models
+ x-speakeasy-name-override: list
+ /models/{author}/{slug}/endpoints:
+ get:
+ operationId: listEndpoints
+ parameters:
+ - description: The author/organization of the model
+ in: path
+ name: author
+ required: true
+ schema:
+ description: The author/organization of the model
+ example: openai
+ type: string
+ - description: The model slug
+ in: path
+ name: slug
+ required: true
+ schema:
+ description: The model slug
+ example: gpt-4
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ created: 1692901234
+ description: GPT-4 is a large multimodal model.
+ endpoints: []
+ id: openai/gpt-4
+ name: GPT-4
+ schema:
+ example:
+ data:
+ architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ created: 1692901234
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ endpoints:
+ - context_length: 8192
+ latency_last_30m:
+ p50: 0.25
+ p75: 0.35
+ p90: 0.48
+ p99: 0.85
+ max_completion_tokens: 4096
+ max_prompt_tokens: 8192
+ model_id: openai/gpt-4
+ model_name: GPT-4
+ name: 'OpenAI: GPT-4'
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ provider_name: OpenAI
+ quantization: fp16
+ status: default
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ supports_implicit_caching: true
+ tag: openai
+ throughput_last_30m:
+ p50: 45.2
+ p75: 38.5
+ p90: 28.3
+ p99: 15.1
+ uptime_last_1d: 99.8
+ uptime_last_30m: 99.5
+ uptime_last_5m: 100
+ id: openai/gpt-4
+ name: GPT-4
+ properties:
+ data:
+ $ref: '#/components/schemas/ListEndpointsResponse'
+ required:
+ - data
+ type: object
+ description: Returns a list of endpoints
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- /key:
- get:
- operationId: getCurrentKey
- x-speakeasy-name-override: getCurrentKeyMetadata
- tags:
- - API Keys
- summary: Get current API key
- description: Get information on the API key associated with the current authentication session
- responses:
- '200':
- description: API key details
- content:
- application/json:
schema:
- type: object
- properties:
- data:
- type: object
- properties:
- label:
- type: string
- description: Human-readable label for the API key
- example: sk-or-v1-0e6...1c96
- limit:
- type: number
- format: double
- description: Spending limit for the API key in USD
- example: 100
- usage:
- type: number
- format: double
- description: Total OpenRouter credit usage (in USD) for the API key
- example: 25.5
- usage_daily:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC day
- example: 25.5
- usage_weekly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
- example: 25.5
- usage_monthly:
- type: number
- format: double
- description: OpenRouter credit usage (in USD) for the current UTC month
- example: 25.5
- byok_usage:
- type: number
- format: double
- description: Total external BYOK usage (in USD) for the API key
- example: 17.38
- byok_usage_daily:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC day
- example: 17.38
- byok_usage_weekly:
- type: number
- format: double
- description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
- example: 17.38
- byok_usage_monthly:
- type: number
- format: double
- description: External BYOK usage (in USD) for current UTC month
- example: 17.38
- is_free_tier:
- type: boolean
- description: Whether this is a free tier API key
- example: false
- is_management_key:
- type: boolean
- description: Whether this is a management key
- example: false
- is_provisioning_key:
- type: boolean
- description: Whether this is a management key
- deprecated: true
- example: false
- limit_remaining:
- type: number
- format: double
- description: Remaining spending limit in USD
- example: 74.5
- limit_reset:
- type: string
- nullable: true
- description: Type of limit reset for the API key
- example: monthly
- include_byok_in_limit:
- type: boolean
- description: Whether to include external BYOK usage in the credit limit
- example: false
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: ISO 8601 UTC timestamp when the API key expires, or null if no expiration
- example: '2027-12-31T23:59:59Z'
- creator_user_id:
- type: string
- nullable: true
- description: >-
- The user ID of the key creator. For organization-owned keys, this is the member who created
- the key. For individual users, this is the user's own ID.
- example: user_2dHFtVWx2n56w6HkM0000000000
- rate_limit:
- type: object
- properties:
- requests:
- type: integer
- description: Number of requests allowed per interval
- example: 1000
- interval:
- type: string
- description: Rate limit interval
- example: 1h
- note:
- type: string
- description: Note about the rate limit
- example: This field is deprecated and safe to ignore.
- required:
- - requests
- - interval
- - note
- description: Legacy rate limit information about a key. Will always return -1.
- deprecated: true
- example:
- requests: 1000
- interval: 1h
- note: This field is deprecated and safe to ignore.
- required:
- - label
- - limit
- - usage
- - usage_daily
- - usage_weekly
- - usage_monthly
- - byok_usage
- - byok_usage_daily
- - byok_usage_weekly
- - byok_usage_monthly
- - is_free_tier
- - is_management_key
- - is_provisioning_key
- - limit_remaining
- - limit_reset
- - include_byok_in_limit
- - creator_user_id
- - rate_limit
- description: Current API key information
- example:
- label: sk-or-v1-au7...890
- limit: 100
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- is_free_tier: false
- is_management_key: false
- is_provisioning_key: false
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- rate_limit:
- requests: 1000
- interval: 1h
- note: This field is deprecated and safe to ignore.
- required:
- - data
- example:
- data:
- label: sk-or-v1-au7...890
- limit: 100
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- is_free_tier: false
- is_management_key: false
- is_provisioning_key: false
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- rate_limit:
- requests: 1000
- interval: 1h
- note: This field is deprecated and safe to ignore.
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all endpoints for a model
+ tags:
+ - Endpoints
+ x-speakeasy-name-override: list
+ /models/count:
+ get:
+ operationId: listModelsCount
+ parameters:
+ - description: >-
+ Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
+ embeddings) or "all" to include all models. Defaults to "text".
+ in: query
+ name: output_modalities
+ required: false
+ schema:
+ description: >-
+ Filter models by output modality. Accepts a comma-separated list of modalities (text, image, audio,
+ embeddings) or "all" to include all models. Defaults to "text".
+ example: text
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
example:
data:
- label: sk-or-v1-au7...890
- limit: 100
- usage: 25.5
- usage_daily: 25.5
- usage_weekly: 25.5
- usage_monthly: 25.5
- byok_usage: 17.38
- byok_usage_daily: 17.38
- byok_usage_weekly: 17.38
- byok_usage_monthly: 17.38
- is_free_tier: false
- is_management_key: false
- is_provisioning_key: false
- limit_remaining: 74.5
- limit_reset: monthly
- include_byok_in_limit: false
- expires_at: '2027-12-31T23:59:59Z'
- creator_user_id: user_2dHFtVWx2n56w6HkM0000000000
- rate_limit:
- requests: 1000
- interval: 1h
- note: This field is deprecated and safe to ignore.
- '401':
- description: Unauthorized - Authentication required or invalid credentials
+ count: 150
+ schema:
+ $ref: '#/components/schemas/ModelsCountResponse'
+ description: Returns the total count of available models
+ '400':
content:
application/json:
+ example:
+ error:
+ code: 400
+ message: Invalid request parameters
schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
+ '500':
+ content:
+ application/json:
+ example:
+ error:
+ code: 500
+ message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: Get total count of available models
+ tags:
+ - Models
+ x-speakeasy-name-override: count
+ /models/user:
+ get:
+ description: >-
+ List models filtered by user provider preferences, [privacy
+ settings](https://openrouter.ai/docs/guides/privacy/provider-logging), and
+ [guardrails](https://openrouter.ai/docs/guides/features/guardrails). If requesting through
+ `eu.openrouter.ai/api/v1/...` the results will be filtered to models that satisfy [EU in-region
+ routing](https://openrouter.ai/docs/guides/privacy/provider-logging#enterprise-eu-in-region-routing).
+ operationId: listModelsUser
+ responses:
+ '200':
+ content:
+ application/json:
+ example:
+ data:
+ - architecture:
+ input_modalities:
+ - text
+ instruct_type: chatml
+ modality: text->text
+ output_modalities:
+ - text
+ tokenizer: GPT
+ canonical_slug: openai/gpt-4
+ context_length: 8192
+ created: 1692901234
+ default_parameters: null
+ description: GPT-4 is a large multimodal model that can solve difficult problems with greater accuracy.
+ expiration_date: null
+ id: openai/gpt-4
+ knowledge_cutoff: null
+ links:
+ details: /api/v1/models/openai/gpt-5.4/endpoints
+ name: GPT-4
+ per_request_limits: null
+ pricing:
+ completion: '0.00006'
+ image: '0'
+ prompt: '0.00003'
+ request: '0'
+ supported_parameters:
+ - temperature
+ - top_p
+ - max_tokens
+ top_provider:
+ context_length: 8192
+ is_moderated: true
+ max_completion_tokens: 4096
+ schema:
+ $ref: '#/components/schemas/ModelsListResponse'
+ description: Returns a list of models filtered by user provider preferences
+ '401':
+ content:
+ application/json:
example:
error:
code: 401
message: Missing Authentication header
- '500':
- description: Internal Server Error - Unexpected server error
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
content:
application/json:
+ example:
+ error:
+ code: 404
+ message: Resource not found
schema:
- $ref: '#/components/schemas/InternalServerResponse'
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '500':
+ content:
+ application/json:
example:
error:
code: 500
message: Internal Server Error
- /auth/keys:
- post:
- operationId: exchangeAuthCodeForAPIKey
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ security:
+ - bearer: []
+ summary: List models filtered by user provider preferences, privacy settings, and guardrails
tags:
- - OAuth
- summary: Exchange authorization code for API key
- description: Exchange an authorization code from the PKCE flow for a user-controlled API key
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- code:
- type: string
- description: The authorization code received from the OAuth redirect
- example: auth_code_abc123def456
- code_verifier:
- type: string
- description: The code verifier if code_challenge was used in the authorization request
- example: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
- code_challenge_method:
- type: string
- nullable: true
- enum:
- - S256
- - plain
- - null
- description: The method used to generate the code challenge
- example: S256
- required:
- - code
- example:
- code: auth_code_abc123def456
- code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
- code_challenge_method: S256
- example:
- code: auth_code_abc123def456
- code_verifier: dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk
- code_challenge_method: S256
- required: true
+ - Models
+ x-speakeasy-name-override: listForUser
+ /organization/members:
+ get:
+ description: >-
+ List all members of the organization associated with the authenticated management key. [Management
+ key](/docs/guides/overview/auth/management-api-keys) required.
+ operationId: listOrganizationMembers
+ parameters:
+ - description: Number of records to skip for pagination
+ in: query
+ name: offset
+ required: false
+ schema:
+ description: Number of records to skip for pagination
+ example: 0
+ minimum: 0
+ type: integer
+ - description: Maximum number of records to return (max 100)
+ in: query
+ name: limit
+ required: false
+ schema:
+ description: Maximum number of records to return (max 100)
+ example: 50
+ maximum: 100
+ minimum: 1
+ type: integer
responses:
'200':
- description: Successfully exchanged code for an API key
content:
application/json:
+ example:
+ data:
+ - email: jane.doe@example.com
+ first_name: Jane
+ id: user_2dHFtVWx2n56w6HkM0000000000
+ last_name: Doe
+ role: member
+ total_count: 25
schema:
- type: object
properties:
- key:
- type: string
- description: The API key to use for OpenRouter requests
- example: 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
- user_id:
- type: string
- nullable: true
- description: User ID associated with the API key
- example: user_2yOPcMpKoQhcd4bVgSMlELRaIah
+ data:
+ description: List of organization members
+ items:
+ properties:
+ email:
+ description: Email address of the member
+ example: jane.doe@example.com
+ type: string
+ first_name:
+ description: First name of the member
+ example: Jane
+ nullable: true
+ type: string
+ id:
+ description: User ID of the organization member
+ example: user_2dHFtVWx2n56w6HkM0000000000
+ type: string
+ last_name:
+ description: Last name of the member
+ example: Doe
+ nullable: true
+ type: string
+ role:
+ description: Role of the member in the organization
+ enum:
+ - org:admin
+ - org:member
+ example: org:member
+ type: string
+ required:
+ - id
+ - first_name
+ - last_name
+ - email
+ - role
+ type: object
+ type: array
+ total_count:
+ description: Total number of members in the organization
+ example: 25
+ type: integer
required:
- - key
- - user_id
- example:
- key: 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
- user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah
- example:
- key: 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
- user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah
- '400':
- description: Bad Request - Invalid request parameters or malformed input
+ - data
+ - total_count
+ type: object
+ description: List of organization members
+ '401':
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
- code: 400
- message: Invalid request parameters
- '403':
- description: Forbidden - Authentication successful but insufficient permissions
+ code: 401
+ message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
+ '404':
content:
application/json:
- schema:
- $ref: '#/components/schemas/ForbiddenResponse'
example:
error:
- code: 403
- message: Only management keys can perform this operation
+ code: 404
+ message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- /auth/keys/code:
- post:
- x-speakeasy-name-override: createAuthCode
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List organization members
tags:
- - OAuth
- summary: Create authorization code
- description: Create an authorization code for the PKCE flow to generate a user-controlled API key
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- callback_url:
- type: string
- format: uri
- description: >-
- The callback URL to redirect to after authorization. Note, only https URLs on ports 443 and 3000 are
- allowed.
- example: https://myapp.com/auth/callback
- code_challenge:
- type: string
- description: PKCE code challenge for enhanced security
- example: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
- code_challenge_method:
- type: string
- enum:
- - S256
- - plain
- description: The method used to generate the code challenge
- example: S256
- limit:
- type: number
- format: double
- description: Credit limit for the API key to be created
- example: 100
- expires_at:
- type: string
- nullable: true
- format: date-time
- description: Optional expiration time for the API key to be created
- example: '2027-12-31T23:59:59Z'
- key_label:
- type: string
- maxLength: 100
- description: Optional custom label for the API key. Defaults to the app name if not provided.
- example: My Custom Key
- usage_limit_type:
- type: string
- enum:
- - daily
- - weekly
- - monthly
- description: Optional credit limit reset interval. When set, the credit limit resets on this interval.
- example: monthly
- spawn_agent:
- type: string
- description: Agent identifier for spawn telemetry
- example: my-agent
- x-speakeasy-ignore: true
- x-fern-ignore: true
- spawn_cloud:
- type: string
- description: Cloud identifier for spawn telemetry
- example: aws-us-east-1
- x-speakeasy-ignore: true
- x-fern-ignore: true
- required:
- - callback_url
- example:
- callback_url: https://myapp.com/auth/callback
- code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
- code_challenge_method: S256
- limit: 100
- example:
- callback_url: https://myapp.com/auth/callback
- code_challenge: E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM
- code_challenge_method: S256
- limit: 100
- required: true
+ - Organization
+ x-speakeasy-name-override: listMembers
+ x-speakeasy-pagination:
+ inputs:
+ - in: parameters
+ name: offset
+ type: offset
+ - in: parameters
+ name: limit
+ type: limit
+ outputs:
+ results: $.data
+ type: offsetLimit
+ /providers:
+ get:
+ operationId: listProviders
responses:
'200':
- description: Successfully created authorization code
content:
application/json:
- schema:
- type: object
- properties:
- data:
- type: object
- properties:
- id:
- type: string
- description: The authorization code ID to use in the exchange request
- example: auth_code_xyz789
- app_id:
- type: integer
- description: The application ID associated with this auth code
- example: 12345
- created_at:
- type: string
- description: ISO 8601 timestamp of when the auth code was created
- example: '2025-08-24T10:30:00Z'
- required:
- - id
- - app_id
- - created_at
- description: Auth code data
- example:
- id: auth_code_xyz789
- app_id: 12345
- created_at: '2025-08-24T10:30:00Z'
- required:
- - data
- example:
- data:
- id: auth_code_xyz789
- app_id: 12345
- created_at: '2025-08-24T10:30:00Z'
example:
data:
- id: auth_code_xyz789
- app_id: 12345
- created_at: '2025-08-24T10:30:00Z'
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '401':
- description: Unauthorized - Authentication required or invalid credentials
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
- example:
- error:
- code: 401
- message: Missing Authentication header
- '409':
- description: Conflict - Resource conflict or concurrent modification
- content:
- application/json:
+ - datacenters:
+ - US
+ - IE
+ headquarters: US
+ name: OpenAI
+ privacy_policy_url: https://openai.com/privacy
+ slug: openai
+ status_page_url: https://status.openai.com
+ terms_of_service_url: https://openai.com/terms
schema:
- $ref: '#/components/schemas/ConflictResponse'
- example:
- error:
- code: 409
- message: Resource conflict. Please try again later.
+ example:
+ data:
+ - datacenters:
+ - US
+ - IE
+ headquarters: US
+ name: OpenAI
+ privacy_policy_url: https://openai.com/privacy
+ slug: openai
+ status_page_url: https://status.openai.com
+ terms_of_service_url: https://openai.com/terms
+ properties:
+ data:
+ items:
+ example:
+ datacenters:
+ - US
+ - IE
+ headquarters: US
+ name: OpenAI
+ privacy_policy_url: https://openai.com/privacy
+ slug: openai
+ status_page_url: https://status.openai.com
+ terms_of_service_url: https://openai.com/terms
+ properties:
+ datacenters:
+ description: ISO 3166-1 Alpha-2 country codes of the provider datacenter locations
+ example:
+ - US
+ - IE
+ items:
+ enum:
+ - AD
+ - AE
+ - AF
+ - AG
+ - AI
+ - AL
+ - AM
+ - AO
+ - AQ
+ - AR
+ - AS
+ - AT
+ - AU
+ - AW
+ - AX
+ - AZ
+ - BA
+ - BB
+ - BD
+ - BE
+ - BF
+ - BG
+ - BH
+ - BI
+ - BJ
+ - BL
+ - BM
+ - BN
+ - BO
+ - BQ
+ - BR
+ - BS
+ - BT
+ - BV
+ - BW
+ - BY
+ - BZ
+ - CA
+ - CC
+ - CD
+ - CF
+ - CG
+ - CH
+ - CI
+ - CK
+ - CL
+ - CM
+ - CN
+ - CO
+ - CR
+ - CU
+ - CV
+ - CW
+ - CX
+ - CY
+ - CZ
+ - DE
+ - DJ
+ - DK
+ - DM
+ - DO
+ - DZ
+ - EC
+ - EE
+ - EG
+ - EH
+ - ER
+ - ES
+ - ET
+ - FI
+ - FJ
+ - FK
+ - FM
+ - FO
+ - FR
+ - GA
+ - GB
+ - GD
+ - GE
+ - GF
+ - GG
+ - GH
+ - GI
+ - GL
+ - GM
+ - GN
+ - GP
+ - GQ
+ - GR
+ - GS
+ - GT
+ - GU
+ - GW
+ - GY
+ - HK
+ - HM
+ - HN
+ - HR
+ - HT
+ - HU
+ - ID
+ - IE
+ - IL
+ - IM
+ - IN
+ - IO
+ - IQ
+ - IR
+ - IS
+ - IT
+ - JE
+ - JM
+ - JO
+ - JP
+ - KE
+ - KG
+ - KH
+ - KI
+ - KM
+ - KN
+ - KP
+ - KR
+ - KW
+ - KY
+ - KZ
+ - LA
+ - LB
+ - LC
+ - LI
+ - LK
+ - LR
+ - LS
+ - LT
+ - LU
+ - LV
+ - LY
+ - MA
+ - MC
+ - MD
+ - ME
+ - MF
+ - MG
+ - MH
+ - MK
+ - ML
+ - MM
+ - MN
+ - MO
+ - MP
+ - MQ
+ - MR
+ - MS
+ - MT
+ - MU
+ - MV
+ - MW
+ - MX
+ - MY
+ - MZ
+ - NA
+ - NC
+ - NE
+ - NF
+ - NG
+ - NI
+ - NL
+ - 'NO'
+ - NP
+ - NR
+ - NU
+ - NZ
+ - OM
+ - PA
+ - PE
+ - PF
+ - PG
+ - PH
+ - PK
+ - PL
+ - PM
+ - PN
+ - PR
+ - PS
+ - PT
+ - PW
+ - PY
+ - QA
+ - RE
+ - RO
+ - RS
+ - RU
+ - RW
+ - SA
+ - SB
+ - SC
+ - SD
+ - SE
+ - SG
+ - SH
+ - SI
+ - SJ
+ - SK
+ - SL
+ - SM
+ - SN
+ - SO
+ - SR
+ - SS
+ - ST
+ - SV
+ - SX
+ - SY
+ - SZ
+ - TC
+ - TD
+ - TF
+ - TG
+ - TH
+ - TJ
+ - TK
+ - TL
+ - TM
+ - TN
+ - TO
+ - TR
+ - TT
+ - TV
+ - TW
+ - TZ
+ - UA
+ - UG
+ - UM
+ - US
+ - UY
+ - UZ
+ - VA
+ - VC
+ - VE
+ - VG
+ - VI
+ - VN
+ - VU
+ - WF
+ - WS
+ - YE
+ - YT
+ - ZA
+ - ZM
+ - ZW
+ type: string
+ nullable: true
+ type: array
+ headquarters:
+ description: ISO 3166-1 Alpha-2 country code of the provider headquarters
+ enum:
+ - AD
+ - AE
+ - AF
+ - AG
+ - AI
+ - AL
+ - AM
+ - AO
+ - AQ
+ - AR
+ - AS
+ - AT
+ - AU
+ - AW
+ - AX
+ - AZ
+ - BA
+ - BB
+ - BD
+ - BE
+ - BF
+ - BG
+ - BH
+ - BI
+ - BJ
+ - BL
+ - BM
+ - BN
+ - BO
+ - BQ
+ - BR
+ - BS
+ - BT
+ - BV
+ - BW
+ - BY
+ - BZ
+ - CA
+ - CC
+ - CD
+ - CF
+ - CG
+ - CH
+ - CI
+ - CK
+ - CL
+ - CM
+ - CN
+ - CO
+ - CR
+ - CU
+ - CV
+ - CW
+ - CX
+ - CY
+ - CZ
+ - DE
+ - DJ
+ - DK
+ - DM
+ - DO
+ - DZ
+ - EC
+ - EE
+ - EG
+ - EH
+ - ER
+ - ES
+ - ET
+ - FI
+ - FJ
+ - FK
+ - FM
+ - FO
+ - FR
+ - GA
+ - GB
+ - GD
+ - GE
+ - GF
+ - GG
+ - GH
+ - GI
+ - GL
+ - GM
+ - GN
+ - GP
+ - GQ
+ - GR
+ - GS
+ - GT
+ - GU
+ - GW
+ - GY
+ - HK
+ - HM
+ - HN
+ - HR
+ - HT
+ - HU
+ - ID
+ - IE
+ - IL
+ - IM
+ - IN
+ - IO
+ - IQ
+ - IR
+ - IS
+ - IT
+ - JE
+ - JM
+ - JO
+ - JP
+ - KE
+ - KG
+ - KH
+ - KI
+ - KM
+ - KN
+ - KP
+ - KR
+ - KW
+ - KY
+ - KZ
+ - LA
+ - LB
+ - LC
+ - LI
+ - LK
+ - LR
+ - LS
+ - LT
+ - LU
+ - LV
+ - LY
+ - MA
+ - MC
+ - MD
+ - ME
+ - MF
+ - MG
+ - MH
+ - MK
+ - ML
+ - MM
+ - MN
+ - MO
+ - MP
+ - MQ
+ - MR
+ - MS
+ - MT
+ - MU
+ - MV
+ - MW
+ - MX
+ - MY
+ - MZ
+ - NA
+ - NC
+ - NE
+ - NF
+ - NG
+ - NI
+ - NL
+ - 'NO'
+ - NP
+ - NR
+ - NU
+ - NZ
+ - OM
+ - PA
+ - PE
+ - PF
+ - PG
+ - PH
+ - PK
+ - PL
+ - PM
+ - PN
+ - PR
+ - PS
+ - PT
+ - PW
+ - PY
+ - QA
+ - RE
+ - RO
+ - RS
+ - RU
+ - RW
+ - SA
+ - SB
+ - SC
+ - SD
+ - SE
+ - SG
+ - SH
+ - SI
+ - SJ
+ - SK
+ - SL
+ - SM
+ - SN
+ - SO
+ - SR
+ - SS
+ - ST
+ - SV
+ - SX
+ - SY
+ - SZ
+ - TC
+ - TD
+ - TF
+ - TG
+ - TH
+ - TJ
+ - TK
+ - TL
+ - TM
+ - TN
+ - TO
+ - TR
+ - TT
+ - TV
+ - TW
+ - TZ
+ - UA
+ - UG
+ - UM
+ - US
+ - UY
+ - UZ
+ - VA
+ - VC
+ - VE
+ - VG
+ - VI
+ - VN
+ - VU
+ - WF
+ - WS
+ - YE
+ - YT
+ - ZA
+ - ZM
+ - ZW
+ - null
+ example: US
+ nullable: true
+ type: string
+ name:
+ description: Display name of the provider
+ example: OpenAI
+ type: string
+ privacy_policy_url:
+ description: URL to the provider's privacy policy
+ example: https://openai.com/privacy
+ nullable: true
+ type: string
+ slug:
+ description: URL-friendly identifier for the provider
+ example: openai
+ type: string
+ status_page_url:
+ description: URL to the provider's status page
+ example: https://status.openai.com
+ nullable: true
+ type: string
+ terms_of_service_url:
+ description: URL to the provider's terms of service
+ example: https://openai.com/terms
+ nullable: true
+ type: string
+ required:
+ - name
+ - slug
+ - privacy_policy_url
+ type: object
+ type: array
+ required:
+ - data
+ type: object
+ description: Returns a list of providers
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
- operationId: createAuthKeysCode
- /embeddings:
- post:
- x-speakeasy-name-override: generate
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
+ summary: List all providers
tags:
- - Embeddings
- summary: Submit an embedding request
- description: Submits an embedding request to the embeddings router
+ - Providers
+ x-speakeasy-name-override: list
+ /rerank:
+ post:
+ description: Submits a rerank request to the rerank router
+ operationId: createRerank
requestBody:
content:
application/json:
+ example:
+ documents:
+ - Paris is the capital of France.
+ - Berlin is the capital of Germany.
+ - Madrid is the capital of Spain.
+ model: cohere/rerank-v3.5
+ query: What is the capital of France?
schema:
- type: object
+ description: Rerank request input
+ example:
+ documents:
+ - Paris is the capital of France.
+ - Berlin is the capital of Germany.
+ model: cohere/rerank-v3.5
+ query: What is the capital of France?
+ top_n: 3
properties:
- input:
- anyOf:
- - type: string
- - type: array
- items:
- type: string
- - type: array
- items:
- type: number
- - type: array
- items:
- type: array
- items:
- type: number
- - type: array
- items:
- type: object
- properties:
- content:
- type: array
- items:
- oneOf:
- - type: object
- properties:
- type:
- type: string
- enum:
- - text
- text:
- type: string
- required:
- - type
- - text
- - type: object
- properties:
- type:
- type: string
- enum:
- - image_url
- image_url:
- type: object
- properties:
- url:
- type: string
- required:
- - url
- required:
- - type
- - image_url
- required:
- - content
- description: Text, token, or multimodal input(s) to embed
- example: The quick brown fox jumps over the lazy dog
+ documents:
+ description: The list of documents to rerank
+ example:
+ - Paris is the capital of France.
+ - Berlin is the capital of Germany.
+ items:
+ type: string
+ type: array
model:
+ description: The rerank model to use
+ example: cohere/rerank-v3.5
type: string
- description: The model to use for embeddings
- example: openai/text-embedding-3-small
- encoding_format:
- type: string
- enum:
- - float
- - base64
- description: The format of the output embeddings
- example: float
- dimensions:
- type: integer
- minimum: 0
- exclusiveMinimum: 0
- description: The number of dimensions for the output embeddings
- example: 1536
- user:
- type: string
- description: A unique identifier for the end-user
- example: user-1234
provider:
allOf:
- $ref: '#/components/schemas/ProviderPreferences'
- description: Provider routing preferences for the request.
- input_type:
+ query:
+ description: The search query to rerank documents against
+ example: What is the capital of France?
type: string
- description: The type of input (e.g. search_query, search_document)
- example: search_query
+ top_n:
+ description: Number of most relevant documents to return
+ example: 3
+ exclusiveMinimum: 0
+ minimum: 0
+ type: integer
required:
- - input
- model
- description: Embeddings request input
- example:
- model: openai/text-embedding-3-small
- input: The quick brown fox jumps over the lazy dog
- dimensions: 1536
- example:
- model: openai/text-embedding-3-small
- input: The quick brown fox jumps over the lazy dog
+ - query
+ - documents
+ type: object
required: true
responses:
'200':
- description: Embedding response
content:
application/json:
+ example:
+ id: gen-rerank-1234567890-abc
+ model: cohere/rerank-v3.5
+ results:
+ - document:
+ text: Paris is the capital of France.
+ index: 0
+ relevance_score: 0.98
+ usage:
+ search_units: 1
+ total_tokens: 150
schema:
- type: object
+ description: Rerank response containing ranked results
+ example:
+ id: gen-rerank-1234567890-abc
+ model: cohere/rerank-v3.5
+ results:
+ - document:
+ text: Paris is the capital of France.
+ index: 0
+ relevance_score: 0.98
+ usage:
+ search_units: 1
+ total_tokens: 150
properties:
id:
+ description: Unique identifier for the rerank response (ORID format)
+ example: gen-rerank-1234567890-abc
type: string
- description: Unique identifier for the embeddings response
- example: embd-1234567890
- object:
+ model:
+ description: The model used for reranking
+ example: cohere/rerank-v3.5
type: string
- enum:
- - list
- data:
- type: array
+ provider:
+ description: The provider that served the rerank request
+ example: Cohere
+ type: string
+ results:
+ description: List of rerank results sorted by relevance
+ example:
+ - document:
+ text: Paris is the capital of France.
+ index: 0
+ relevance_score: 0.98
items:
- type: object
- properties:
- object:
- type: string
- enum:
- - embedding
- embedding:
- anyOf:
- - type: array
- items:
- type: number
- - type: string
- description: Embedding vector as an array of floats or a base64 string
- example:
- - 0.0023064255
- - -0.009327292
- - 0.015797347
- index:
- type: integer
- description: Index of the embedding in the input list
- example: 0
- required:
- - object
- - embedding
- description: A single embedding object
+ description: A single rerank result
example:
- object: embedding
- embedding:
- - 0.0023064255
- - -0.009327292
- - 0.015797347
- index: 0
- description: List of embedding objects
- example:
- - object: embedding
- embedding:
- - 0.0023064255
- - -0.009327292
- - 0.015797347
+ document:
+ text: Paris is the capital of France.
index: 0
- model:
- type: string
- description: The model used for embeddings
- example: openai/text-embedding-3-small
+ relevance_score: 0.98
+ properties:
+ document:
+ description: The document object containing the original text
+ properties:
+ text:
+ description: The document text
+ example: Paris is the capital of France.
+ type: string
+ required:
+ - text
+ type: object
+ index:
+ description: Index of the document in the original input list
+ example: 0
+ type: integer
+ relevance_score:
+ description: Relevance score of the document to the query
+ example: 0.98
+ format: double
+ type: number
+ required:
+ - index
+ - relevance_score
+ - document
+ type: object
+ type: array
usage:
- type: object
+ description: Usage statistics
+ example:
+ search_units: 1
+ total_tokens: 150
properties:
- prompt_tokens:
+ cost:
+ description: Cost of the request in credits
+ example: 0.001
+ format: double
+ type: number
+ search_units:
+ description: Number of search units consumed (Cohere billing)
+ example: 1
type: integer
- description: Number of tokens in the input
- example: 8
total_tokens:
- type: integer
description: Total number of tokens used
- example: 8
- cost:
- type: number
- format: double
- description: Cost of the request in credits
- example: 0.0001
- required:
- - prompt_tokens
- - total_tokens
- description: Token usage statistics
- example:
- prompt_tokens: 8
- total_tokens: 8
+ example: 150
+ type: integer
+ type: object
required:
- - object
- - data
- model
- description: Embeddings response containing embedding vectors
- example:
- object: list
- data:
- - object: embedding
- embedding:
- - 0.0023064255
- - -0.009327292
- - 0.015797347
- index: 0
- model: openai/text-embedding-3-small
- usage:
- prompt_tokens: 8
- total_tokens: 8
- example:
- object: list
- data:
- - object: embedding
- embedding:
- - 0.0023064255
- - -0.009327292
- - 0.015797347
- index: 0
- model: openai/text-embedding-3-small
- usage:
- prompt_tokens: 8
- total_tokens: 8
+ - results
+ type: object
text/event-stream:
+ example: 'data: [DONE]'
schema:
+ description: Not used for rerank - rerank does not support streaming
type: string
- description: Not used for embeddings - embeddings do not support streaming
- example: 'data: [DONE]'
x-speakeasy-sse-sentinel: '[DONE]'
+ description: Rerank response
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'402':
- description: Payment Required - Insufficient credits or quota to complete request
content:
application/json:
- schema:
- $ref: '#/components/schemas/PaymentRequiredResponse'
example:
error:
code: 402
message: Insufficient credits. Add more using https://openrouter.ai/credits
+ schema:
+ $ref: '#/components/schemas/PaymentRequiredResponse'
+ description: Payment Required - Insufficient credits or quota to complete request
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
'429':
- description: Too Many Requests - Rate limit exceeded
content:
application/json:
- schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
example:
error:
code: 429
message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
'502':
- description: Bad Gateway - Provider/upstream API failure
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadGatewayResponse'
example:
error:
code: 502
message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: Bad Gateway - Provider/upstream API failure
'503':
- description: Service Unavailable - Service temporarily unavailable
content:
application/json:
- schema:
- $ref: '#/components/schemas/ServiceUnavailableResponse'
example:
error:
code: 503
message: Service temporarily unavailable
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: Service Unavailable - Service temporarily unavailable
'524':
- description: Infrastructure Timeout - Provider request timed out at edge network
content:
application/json:
- schema:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
example:
error:
code: 524
message: Request timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
+ description: Infrastructure Timeout - Provider request timed out at edge network
'529':
- description: Provider Overloaded - Provider is temporarily overloaded
content:
application/json:
- schema:
- $ref: '#/components/schemas/ProviderOverloadedResponse'
example:
error:
code: 529
message: Provider returned error
- operationId: createEmbeddings
- /embeddings/models:
- get:
- tags:
- - Embeddings
- x-speakeasy-name-override: listModels
- summary: List all embeddings models
- description: Returns a list of all available embeddings models and their properties
- responses:
- '200':
- description: Returns a list of embeddings models
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ModelsListResponse'
- example:
- data:
- - id: openai/text-embedding-3-small
- canonical_slug: openai/text-embedding-3-small
- name: Text Embedding 3 Small
- created: 1692901234
- description: OpenAI text embedding model optimized for performance.
- pricing:
- prompt: '0.00000002'
- completion: '0'
- request: '0'
- image: '0'
- context_length: 8192
- architecture:
- tokenizer: GPT
- instruct_type: null
- modality: text->text
- input_modalities:
- - text
- output_modalities:
- - embeddings
- top_provider:
- context_length: 8192
- max_completion_tokens: null
- is_moderated: false
- per_request_limits: null
- supported_parameters: []
- default_parameters: null
- knowledge_cutoff: null
- expiration_date: null
- links:
- details: /api/v1/models/openai/text-embedding-3-small/endpoints
- '400':
- description: Bad Request - Invalid request parameters or malformed input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
- example:
- error:
- code: 400
- message: Invalid request parameters
- '500':
- description: Internal Server Error - Unexpected server error
- content:
- application/json:
schema:
- $ref: '#/components/schemas/InternalServerResponse'
- example:
- error:
- code: 500
- message: Internal Server Error
- operationId: listEmbeddingsModels
- /rerank:
- post:
- x-speakeasy-name-override: rerank
- tags:
- - Rerank
- summary: Submit a rerank request
- description: Submits a rerank request to the rerank router
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- model:
- type: string
- description: The rerank model to use
- example: cohere/rerank-v3.5
- query:
- type: string
- description: The search query to rerank documents against
- example: What is the capital of France?
- documents:
- type: array
- items:
- type: string
- description: The list of documents to rerank
- example:
- - Paris is the capital of France.
- - Berlin is the capital of Germany.
- top_n:
- type: integer
- minimum: 0
- exclusiveMinimum: 0
- description: Number of most relevant documents to return
- example: 3
- provider:
- allOf:
- - $ref: '#/components/schemas/ProviderPreferences'
- - description: Provider routing preferences for the request.
- required:
- - model
- - query
- - documents
- description: Rerank request input
- example:
- model: cohere/rerank-v3.5
- query: What is the capital of France?
- documents:
- - Paris is the capital of France.
- - Berlin is the capital of Germany.
- top_n: 3
+ $ref: '#/components/schemas/ProviderOverloadedResponse'
+ description: Provider Overloaded - Provider is temporarily overloaded
+ summary: Submit a rerank request
+ tags:
+ - Rerank
+ x-speakeasy-name-override: rerank
+ /responses:
+ post:
+ description: Creates a streaming or non-streaming response using OpenResponses API format
+ operationId: createResponses
+ requestBody:
+ content:
+ application/json:
example:
- model: cohere/rerank-v3.5
- query: What is the capital of France?
- documents:
- - Paris is the capital of France.
- - Berlin is the capital of Germany.
- - Madrid is the capital of Spain.
+ input: Tell me a joke
+ model: openai/gpt-4o
+ schema:
+ $ref: '#/components/schemas/ResponsesRequest'
required: true
responses:
'200':
- description: Rerank response
content:
application/json:
- schema:
- type: object
- properties:
- id:
- type: string
- description: Unique identifier for the rerank response (ORID format)
- example: gen-rerank-1234567890-abc
- model:
- type: string
- description: The model used for reranking
- example: cohere/rerank-v3.5
- provider:
- type: string
- description: The provider that served the rerank request
- example: Cohere
- results:
- type: array
- items:
- type: object
- properties:
- index:
- type: integer
- description: Index of the document in the original input list
- example: 0
- relevance_score:
- type: number
- format: double
- description: Relevance score of the document to the query
- example: 0.98
- document:
- type: object
- properties:
- text:
- type: string
- description: The document text
- example: Paris is the capital of France.
- required:
- - text
- description: The document object containing the original text
- required:
- - index
- - relevance_score
- - document
- description: A single rerank result
- example:
- index: 0
- relevance_score: 0.98
- document:
- text: Paris is the capital of France.
- description: List of rerank results sorted by relevance
- example:
- - index: 0
- relevance_score: 0.98
- document:
- text: Paris is the capital of France.
- usage:
- type: object
- properties:
- total_tokens:
- type: integer
- description: Total number of tokens used
- example: 150
- search_units:
- type: integer
- description: Number of search units consumed (Cohere billing)
- example: 1
- cost:
- type: number
- format: double
- description: Cost of the request in credits
- example: 0.001
- description: Usage statistics
- example:
- total_tokens: 150
- search_units: 1
- required:
- - model
- - results
- description: Rerank response containing ranked results
- example:
- id: gen-rerank-1234567890-abc
- model: cohere/rerank-v3.5
- results:
- - index: 0
- relevance_score: 0.98
- document:
- text: Paris is the capital of France.
- usage:
- total_tokens: 150
- search_units: 1
example:
- id: gen-rerank-1234567890-abc
- model: cohere/rerank-v3.5
- results:
- - index: 0
- relevance_score: 0.98
- document:
- text: Paris is the capital of France.
+ created_at: 1700000000
+ id: resp_abc123
+ model: openai/gpt-4o
+ object: response
+ output:
+ - content:
+ - text: Why did the chicken cross the road? To get to the other side!
+ type: output_text
+ role: assistant
+ type: message
+ status: completed
usage:
- total_tokens: 150
- search_units: 1
+ completion_tokens: 20
+ prompt_tokens: 10
+ total_tokens: 30
+ schema:
+ $ref: '#/components/schemas/OpenResponsesResult'
text/event-stream:
+ example:
+ data:
+ delta: Hello
+ type: response.output_text.delta
schema:
- type: string
- description: Not used for rerank - rerank does not support streaming
- example: 'data: [DONE]'
+ properties:
+ data:
+ $ref: '#/components/schemas/StreamEvents'
+ required:
+ - data
+ type: object
x-speakeasy-sse-sentinel: '[DONE]'
+ description: Successful response
'400':
- description: Bad Request - Invalid request parameters or malformed input
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadRequestResponse'
example:
error:
code: 400
message: Invalid request parameters
+ schema:
+ $ref: '#/components/schemas/BadRequestResponse'
+ description: Bad Request - Invalid request parameters or malformed input
'401':
- description: Unauthorized - Authentication required or invalid credentials
content:
application/json:
- schema:
- $ref: '#/components/schemas/UnauthorizedResponse'
example:
error:
code: 401
message: Missing Authentication header
+ schema:
+ $ref: '#/components/schemas/UnauthorizedResponse'
+ description: Unauthorized - Authentication required or invalid credentials
'402':
- description: Payment Required - Insufficient credits or quota to complete request
content:
application/json:
- schema:
- $ref: '#/components/schemas/PaymentRequiredResponse'
example:
error:
code: 402
message: Insufficient credits. Add more using https://openrouter.ai/credits
+ schema:
+ $ref: '#/components/schemas/PaymentRequiredResponse'
+ description: Payment Required - Insufficient credits or quota to complete request
'404':
- description: Not Found - Resource does not exist
content:
application/json:
- schema:
- $ref: '#/components/schemas/NotFoundResponse'
example:
error:
code: 404
message: Resource not found
- '429':
- description: Too Many Requests - Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/NotFoundResponse'
+ description: Not Found - Resource does not exist
+ '408':
content:
application/json:
+ example:
+ error:
+ code: 408
+ message: Operation timed out. Please try again later.
schema:
- $ref: '#/components/schemas/TooManyRequestsResponse'
+ $ref: '#/components/schemas/RequestTimeoutResponse'
+ description: Request Timeout - Operation exceeded time limit
+ '413':
+ content:
+ application/json:
+ example:
+ error:
+ code: 413
+ message: Request payload too large
+ schema:
+ $ref: '#/components/schemas/PayloadTooLargeResponse'
+ description: Payload Too Large - Request payload exceeds size limits
+ '422':
+ content:
+ application/json:
+ example:
+ error:
+ code: 422
+ message: Invalid argument
+ schema:
+ $ref: '#/components/schemas/UnprocessableEntityResponse'
+ description: Unprocessable Entity - Semantic validation failure
+ '429':
+ content:
+ application/json:
example:
error:
code: 429
message: Rate limit exceeded
+ schema:
+ $ref: '#/components/schemas/TooManyRequestsResponse'
+ description: Too Many Requests - Rate limit exceeded
'500':
- description: Internal Server Error - Unexpected server error
content:
application/json:
- schema:
- $ref: '#/components/schemas/InternalServerResponse'
example:
error:
code: 500
message: Internal Server Error
+ schema:
+ $ref: '#/components/schemas/InternalServerResponse'
+ description: Internal Server Error - Unexpected server error
'502':
- description: Bad Gateway - Provider/upstream API failure
content:
application/json:
- schema:
- $ref: '#/components/schemas/BadGatewayResponse'
example:
error:
code: 502
message: Provider returned error
+ schema:
+ $ref: '#/components/schemas/BadGatewayResponse'
+ description: Bad Gateway - Provider/upstream API failure
'503':
- description: Service Unavailable - Service temporarily unavailable
content:
application/json:
- schema:
- $ref: '#/components/schemas/ServiceUnavailableResponse'
example:
error:
code: 503
message: Service temporarily unavailable
+ schema:
+ $ref: '#/components/schemas/ServiceUnavailableResponse'
+ description: Service Unavailable - Service temporarily unavailable
'524':
- description: Infrastructure Timeout - Provider request timed out at edge network
content:
application/json:
- schema:
- $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
example:
error:
code: 524
message: Request timed out. Please try again later.
+ schema:
+ $ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
+ description: Infrastructure Timeout - Provider request timed out at edge network
'529':
- description: Provider Overloaded - Provider is temporarily overloaded
content:
application/json:
- schema:
- $ref: '#/components/schemas/ProviderOverloadedResponse'
example:
error:
code: 529
message: Provider returned error
- operationId: createRerank
+ schema:
+ $ref: '#/components/schemas/ProviderOverloadedResponse'
+ description: Provider Overloaded - Provider is temporarily overloaded
+ summary: Create a response
+ tags:
+ - beta.responses
+ x-speakeasy-name-override: send
+ x-speakeasy-stream-request-field: stream
+security:
+ - apiKey: []
+servers:
+ - description: Production server
+ url: https://openrouter.ai/api/v1
+ x-speakeasy-server-id: production
tags:
- - name: API Keys
- description: API key management endpoints
- - name: Analytics
- description: Analytics and usage endpoints
- - name: Anthropic Messages
- description: Anthropic Messages endpoints
- - name: Chat
- description: Chat completion endpoints
- - name: Credits
- description: Credit management endpoints
- - name: Embeddings
- description: Text embedding endpoints
- - name: Endpoints
- description: Endpoint information
- - name: Generations
- description: Generation history endpoints
- - name: Guardrails
- description: Guardrails endpoints
- - name: Models
- description: Model information endpoints
- - name: OAuth
- description: OAuth authentication endpoints
- - name: Organization
- description: Organization endpoints
- - name: Providers
- description: Provider information endpoints
- - name: Rerank
- description: Reranking endpoints
- - name: beta.responses
- description: beta.responses endpoints
+ - description: API key management endpoints
+ name: API Keys
+ - description: Analytics and usage endpoints
+ name: Analytics
+ - description: Anthropic Messages endpoints
+ name: Anthropic Messages
+ - description: Chat completion endpoints
+ name: Chat
+ - description: Credit management endpoints
+ name: Credits
+ - description: Text embedding endpoints
+ name: Embeddings
+ - description: Endpoint information
+ name: Endpoints
+ - description: Generation history endpoints
+ name: Generations
+ - description: Guardrails endpoints
+ name: Guardrails
+ - description: Model information endpoints
+ name: Models
+ - description: OAuth authentication endpoints
+ name: OAuth
+ - description: Organization endpoints
+ name: Organization
+ - description: Provider information endpoints
+ name: Providers
+ - description: Reranking endpoints
+ name: Rerank
+ - description: beta.responses endpoints
+ name: beta.responses
x-fern-base-path: /
x-retry-strategy:
- type: exponential
initialDelay: 500
- maxDelay: 60000
maxAttempts: 3
+ maxDelay: 60000
+ type: exponential
x-speakeasy-retries:
- strategy: backoff
backoff:
+ exponent: 1.5
initialInterval: 500
- maxInterval: 60000
maxElapsedTime: 3600000
- exponent: 1.5
+ maxInterval: 60000
+ retryConnectionErrors: true
statusCodes:
- 5XX
- retryConnectionErrors: true
+ strategy: backoff