mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
Speakeasy regeneration with latest schema changes including type renames and new server tool models.
19442 lines
680 KiB
YAML
19442 lines
680 KiB
YAML
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:
|
|
schemas:
|
|
OpenAIResponsesResponseStatus:
|
|
type: string
|
|
enum:
|
|
- completed
|
|
- incomplete
|
|
- in_progress
|
|
- failed
|
|
- cancelled
|
|
- queued
|
|
FileCitation:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- file_citation
|
|
file_id:
|
|
type: string
|
|
filename:
|
|
type: string
|
|
index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- file_id
|
|
- filename
|
|
- index
|
|
example:
|
|
type: file_citation
|
|
file_id: file-abc123
|
|
filename: research_paper.pdf
|
|
index: 0
|
|
URLCitation:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url_citation
|
|
url:
|
|
type: string
|
|
title:
|
|
type: string
|
|
start_index:
|
|
type: number
|
|
end_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- url
|
|
- title
|
|
- start_index
|
|
- end_index
|
|
example:
|
|
type: url_citation
|
|
start_index: 0
|
|
end_index: 42
|
|
title: OpenRouter Documentation
|
|
url: https://openrouter.ai/docs
|
|
FilePath:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- file_path
|
|
file_id:
|
|
type: string
|
|
index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- file_id
|
|
- index
|
|
example:
|
|
type: file_path
|
|
file_id: file-xyz789
|
|
index: 0
|
|
OpenAIResponsesAnnotation:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/FileCitation'
|
|
- $ref: '#/components/schemas/URLCitation'
|
|
- $ref: '#/components/schemas/FilePath'
|
|
ResponseOutputText:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- output_text
|
|
text:
|
|
type: string
|
|
annotations:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
|
logprobs:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
bytes:
|
|
type: array
|
|
items:
|
|
type: number
|
|
logprob:
|
|
type: number
|
|
top_logprobs:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
bytes:
|
|
type: array
|
|
items:
|
|
type: number
|
|
logprob:
|
|
type: number
|
|
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:
|
|
type: string
|
|
enum:
|
|
- refusal
|
|
refusal:
|
|
type: string
|
|
required:
|
|
- type
|
|
- refusal
|
|
example:
|
|
type: refusal
|
|
refusal: I'm sorry, I cannot assist with that request
|
|
OutputMessage:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
role:
|
|
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.
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- reasoning_text
|
|
text:
|
|
type: string
|
|
required:
|
|
- type
|
|
- text
|
|
example:
|
|
type: reasoning_text
|
|
text: Let me think step by step about this problem...
|
|
ReasoningSummaryText:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- summary_text
|
|
text:
|
|
type: string
|
|
required:
|
|
- type
|
|
- text
|
|
example:
|
|
type: summary_text
|
|
text: Analyzed the problem using first principles
|
|
OutputItemReasoning:
|
|
type: object
|
|
properties:
|
|
type:
|
|
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:
|
|
type: string
|
|
nullable: true
|
|
status:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- completed
|
|
- type: string
|
|
enum:
|
|
- incomplete
|
|
- type: string
|
|
enum:
|
|
- in_progress
|
|
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:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- unknown
|
|
- openai-responses-v1
|
|
- azure-openai-responses-v1
|
|
- xai-responses-v1
|
|
- anthropic-claude-v1
|
|
- google-gemini-v1
|
|
description: The format of the reasoning content
|
|
example: anthropic-claude-v1
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function_call
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
arguments:
|
|
type: string
|
|
call_id:
|
|
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:
|
|
type: function_call
|
|
id: call-abc123
|
|
name: get_weather
|
|
arguments: '{"location":"San Francisco","unit":"celsius"}'
|
|
call_id: call-abc123
|
|
WebSearchStatus:
|
|
type: string
|
|
enum:
|
|
- completed
|
|
- searching
|
|
- in_progress
|
|
- failed
|
|
example: completed
|
|
OutputItemWebSearchCall:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_call
|
|
id:
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
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:
|
|
type: web_search_call
|
|
id: search-abc123
|
|
action:
|
|
type: search
|
|
query: OpenAI API
|
|
status: completed
|
|
OutputItemFileSearchCall:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- file_search_call
|
|
id:
|
|
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: {}
|
|
example:
|
|
type: file_search_call
|
|
id: filesearch-abc123
|
|
queries:
|
|
- machine learning algorithms
|
|
- neural networks
|
|
status: completed
|
|
ImageGenerationStatus:
|
|
type: string
|
|
enum:
|
|
- in_progress
|
|
- completed
|
|
- generating
|
|
- failed
|
|
example: completed
|
|
OutputItemImageGenerationCall:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image_generation_call
|
|
id:
|
|
type: string
|
|
result:
|
|
type: string
|
|
nullable: true
|
|
default: null
|
|
status:
|
|
$ref: '#/components/schemas/ImageGenerationStatus'
|
|
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:
|
|
type: image_generation_call
|
|
id: imagegen-abc123
|
|
result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==
|
|
status: completed
|
|
OutputServerToolItem:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
pattern: '^openrouter:'
|
|
description: Server tool type (e.g. openrouter:datetime, openrouter:web_search)
|
|
id:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum:
|
|
- completed
|
|
- in_progress
|
|
- incomplete
|
|
required:
|
|
- type
|
|
- status
|
|
additionalProperties:
|
|
nullable: true
|
|
description: A generic OpenRouter server tool output item
|
|
example:
|
|
type: openrouter:web_search
|
|
id: ws_tmp_abc123
|
|
status: completed
|
|
OutputItems:
|
|
anyOf:
|
|
- $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/OutputServerToolItem'
|
|
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
|
|
properties:
|
|
code:
|
|
type: string
|
|
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:
|
|
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: object
|
|
nullable: true
|
|
properties:
|
|
reason:
|
|
type: string
|
|
enum:
|
|
- max_output_tokens
|
|
- content_filter
|
|
OpenAIResponsesUsage:
|
|
type: object
|
|
properties:
|
|
input_tokens:
|
|
type: number
|
|
input_tokens_details:
|
|
type: object
|
|
properties:
|
|
cached_tokens:
|
|
type: number
|
|
required:
|
|
- cached_tokens
|
|
output_tokens:
|
|
type: number
|
|
output_tokens_details:
|
|
type: object
|
|
properties:
|
|
reasoning_tokens:
|
|
type: number
|
|
required:
|
|
- reasoning_tokens
|
|
total_tokens:
|
|
type: number
|
|
required:
|
|
- input_tokens
|
|
- input_tokens_details
|
|
- output_tokens
|
|
- output_tokens_details
|
|
- total_tokens
|
|
Usage:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesUsage'
|
|
- type: object
|
|
nullable: true
|
|
properties:
|
|
cost:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
nullable: true
|
|
upstream_inference_input_cost:
|
|
type: number
|
|
upstream_inference_output_cost:
|
|
type: number
|
|
required:
|
|
- upstream_inference_input_cost
|
|
- upstream_inference_output_cost
|
|
description: Token usage information for the response
|
|
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
|
|
InputText:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_text
|
|
text:
|
|
type: string
|
|
required:
|
|
- type
|
|
- text
|
|
description: Text input content item
|
|
example:
|
|
type: input_text
|
|
text: Hello, how can I help you?
|
|
InputImage:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_image
|
|
detail:
|
|
type: string
|
|
enum:
|
|
- auto
|
|
- high
|
|
- low
|
|
image_url:
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_file
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
file_data:
|
|
type: string
|
|
filename:
|
|
type: string
|
|
file_url:
|
|
type: string
|
|
required:
|
|
- type
|
|
description: File input content item
|
|
example:
|
|
type: input_file
|
|
file_id: file-abc123
|
|
filename: document.pdf
|
|
InputAudio:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_audio
|
|
input_audio:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
format:
|
|
type: string
|
|
enum:
|
|
- mp3
|
|
- wav
|
|
required:
|
|
- data
|
|
- format
|
|
required:
|
|
- type
|
|
- input_audio
|
|
description: Audio input content item
|
|
example:
|
|
type: input_audio
|
|
input_audio:
|
|
data: SGVsbG8gV29ybGQ=
|
|
format: mp3
|
|
ToolCallStatusEnum:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- in_progress
|
|
- completed
|
|
- incomplete
|
|
example: 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
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
type:
|
|
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
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function_call_output
|
|
id:
|
|
type: string
|
|
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:
|
|
$ref: '#/components/schemas/ToolCallStatusEnum'
|
|
required:
|
|
- type
|
|
- call_id
|
|
- output
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function_call
|
|
call_id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
arguments:
|
|
type: string
|
|
id:
|
|
type: string
|
|
status:
|
|
$ref: '#/components/schemas/ToolCallStatusEnum'
|
|
required:
|
|
- type
|
|
- call_id
|
|
- name
|
|
- arguments
|
|
- $ref: '#/components/schemas/OutputItemImageGenerationCall'
|
|
- $ref: '#/components/schemas/OutputMessage'
|
|
- nullable: true
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function
|
|
name:
|
|
type: string
|
|
description:
|
|
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:
|
|
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
|
|
Preview_WebSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_preview
|
|
search_context_size:
|
|
$ref: '#/components/schemas/SearchContextSizeEnum'
|
|
user_location:
|
|
$ref: '#/components/schemas/Preview_WebSearchUserLocation'
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
excluded_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
required:
|
|
- type
|
|
description: Web search preview tool configuration
|
|
example:
|
|
type: web_search_preview
|
|
Preview_20250311_WebSearchServerTool:
|
|
type: object
|
|
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:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
excluded_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
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
|
|
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
|
|
description: User location information for web search
|
|
example:
|
|
type: approximate
|
|
city: San Francisco
|
|
country: USA
|
|
region: California
|
|
timezone: America/Los_Angeles
|
|
Legacy_WebSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
filters:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
excluded_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
search_context_size:
|
|
$ref: '#/components/schemas/SearchContextSizeEnum'
|
|
user_location:
|
|
$ref: '#/components/schemas/WebSearchUserLocation'
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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
|
|
required:
|
|
- type
|
|
description: Web search tool configuration
|
|
example:
|
|
type: web_search
|
|
engine: auto
|
|
filters:
|
|
allowed_domains:
|
|
- example.com
|
|
WebSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_2025_08_26
|
|
filters:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
excluded_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
search_context_size:
|
|
$ref: '#/components/schemas/SearchContextSizeEnum'
|
|
user_location:
|
|
$ref: '#/components/schemas/WebSearchUserLocation'
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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
|
|
required:
|
|
- type
|
|
description: Web search tool configuration (2025-08-26 version)
|
|
example:
|
|
type: web_search_2025_08_26
|
|
engine: auto
|
|
filters:
|
|
allowed_domains:
|
|
- example.com
|
|
CompoundFilter:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- and
|
|
- or
|
|
filters:
|
|
type: array
|
|
items:
|
|
type: object
|
|
additionalProperties:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- filters
|
|
description: A compound filter that combines multiple comparison or compound filters
|
|
FileSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
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
|
|
- type: boolean
|
|
- type: array
|
|
items:
|
|
anyOf:
|
|
- type: string
|
|
- type: number
|
|
required:
|
|
- key
|
|
- type
|
|
- value
|
|
- $ref: '#/components/schemas/CompoundFilter'
|
|
- nullable: true
|
|
max_num_results:
|
|
type: integer
|
|
minimum: 1
|
|
maximum: 50
|
|
ranking_options:
|
|
type: object
|
|
properties:
|
|
ranker:
|
|
type: string
|
|
enum:
|
|
- auto
|
|
- default-2024-11-15
|
|
score_threshold:
|
|
type: number
|
|
required:
|
|
- type
|
|
- vector_store_ids
|
|
description: File search tool configuration
|
|
example:
|
|
type: file_search
|
|
vector_store_ids:
|
|
- vs_abc123
|
|
ComputerUseServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- computer_use_preview
|
|
display_height:
|
|
type: number
|
|
display_width:
|
|
type: number
|
|
environment:
|
|
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:
|
|
type: object
|
|
properties:
|
|
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
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- container
|
|
description: Code interpreter tool configuration
|
|
example:
|
|
type: code_interpreter
|
|
container: auto
|
|
McpServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- mcp
|
|
server_label:
|
|
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
|
|
- nullable: true
|
|
authorization:
|
|
type: string
|
|
connector_id:
|
|
type: string
|
|
enum:
|
|
- connector_dropbox
|
|
- connector_gmail
|
|
- connector_googlecalendar
|
|
- connector_googledrive
|
|
- connector_microsoftteams
|
|
- connector_outlookcalendar
|
|
- connector_outlookemail
|
|
- connector_sharepoint
|
|
headers:
|
|
type: object
|
|
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
|
|
- nullable: true
|
|
server_description:
|
|
type: string
|
|
server_url:
|
|
type: string
|
|
required:
|
|
- 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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image_generation
|
|
background:
|
|
type: string
|
|
enum:
|
|
- transparent
|
|
- opaque
|
|
- auto
|
|
input_fidelity:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- high
|
|
- low
|
|
input_image_mask:
|
|
type: object
|
|
properties:
|
|
image_url:
|
|
type: string
|
|
file_id:
|
|
type: string
|
|
model:
|
|
type: string
|
|
enum:
|
|
- gpt-image-1
|
|
- gpt-image-1-mini
|
|
moderation:
|
|
type: string
|
|
enum:
|
|
- auto
|
|
- low
|
|
output_compression:
|
|
type: number
|
|
output_format:
|
|
type: string
|
|
enum:
|
|
- png
|
|
- webp
|
|
- jpeg
|
|
partial_images:
|
|
type: number
|
|
quality:
|
|
type: string
|
|
enum:
|
|
- low
|
|
- medium
|
|
- high
|
|
- auto
|
|
size:
|
|
type: string
|
|
enum:
|
|
- 1024x1024
|
|
- 1024x1536
|
|
- 1536x1024
|
|
- auto
|
|
required:
|
|
- type
|
|
description: Image generation tool configuration
|
|
example:
|
|
type: image_generation
|
|
quality: high
|
|
CodexLocalShellTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- local_shell
|
|
required:
|
|
- type
|
|
description: Local shell tool configuration
|
|
example:
|
|
type: local_shell
|
|
ShellServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- shell
|
|
required:
|
|
- type
|
|
description: Shell tool configuration
|
|
example:
|
|
type: shell
|
|
ApplyPatchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- apply_patch
|
|
required:
|
|
- type
|
|
description: Apply patch tool configuration
|
|
example:
|
|
type: apply_patch
|
|
CustomTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- custom
|
|
name:
|
|
type: string
|
|
description:
|
|
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:
|
|
- type
|
|
- name
|
|
description: Custom tool configuration
|
|
example:
|
|
type: custom
|
|
name: my_tool
|
|
OpenAIResponsesToolChoice:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- auto
|
|
- type: string
|
|
enum:
|
|
- none
|
|
- type: string
|
|
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
|
|
StoredPromptTemplate:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
id:
|
|
type: string
|
|
variables:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
anyOf:
|
|
- type: string
|
|
- $ref: '#/components/schemas/InputText'
|
|
- $ref: '#/components/schemas/InputImage'
|
|
- $ref: '#/components/schemas/InputFile'
|
|
required:
|
|
- id
|
|
ReasoningEffortEnum:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- xhigh
|
|
- high
|
|
- medium
|
|
- low
|
|
- minimal
|
|
- none
|
|
ReasoningSummaryVerbosityEnum:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- auto
|
|
- concise
|
|
- detailed
|
|
example: auto
|
|
BaseReasoningConfig:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
effort:
|
|
$ref: '#/components/schemas/ReasoningEffortEnum'
|
|
summary:
|
|
$ref: '#/components/schemas/ReasoningSummaryVerbosityEnum'
|
|
TruncationEnum:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- auto
|
|
- disabled
|
|
FormatTextConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
required:
|
|
- type
|
|
description: Plain text response format
|
|
example:
|
|
type: text
|
|
FormatJsonObjectConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- json_object
|
|
required:
|
|
- type
|
|
description: JSON object response format
|
|
example:
|
|
type: json_object
|
|
FormatJsonSchemaConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- json_schema
|
|
name:
|
|
type: string
|
|
description:
|
|
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:
|
|
type: object
|
|
properties:
|
|
format:
|
|
$ref: '#/components/schemas/Formats'
|
|
verbosity:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- high
|
|
- low
|
|
- medium
|
|
description: Text output configuration including format and verbosity
|
|
example:
|
|
format:
|
|
type: text
|
|
verbosity: medium
|
|
ServiceTierEnum:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- auto
|
|
- default
|
|
- flex
|
|
- priority
|
|
- scale
|
|
BaseResponsesResult:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
object:
|
|
type: string
|
|
enum:
|
|
- response
|
|
created_at:
|
|
type: number
|
|
model:
|
|
type: string
|
|
status:
|
|
$ref: '#/components/schemas/OpenAIResponsesResponseStatus'
|
|
completed_at:
|
|
type: number
|
|
nullable: true
|
|
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:
|
|
type: string
|
|
nullable: true
|
|
output_text:
|
|
type: string
|
|
prompt_cache_key:
|
|
type: string
|
|
nullable: true
|
|
safety_identifier:
|
|
type: string
|
|
nullable: true
|
|
error:
|
|
$ref: '#/components/schemas/ResponsesErrorField'
|
|
incomplete_details:
|
|
$ref: '#/components/schemas/IncompleteDetails'
|
|
usage:
|
|
$ref: '#/components/schemas/OpenAIResponsesUsage'
|
|
max_tool_calls:
|
|
type: number
|
|
nullable: true
|
|
top_logprobs:
|
|
type: number
|
|
max_output_tokens:
|
|
type: number
|
|
nullable: true
|
|
temperature:
|
|
type: number
|
|
nullable: true
|
|
top_p:
|
|
type: number
|
|
nullable: true
|
|
presence_penalty:
|
|
type: number
|
|
nullable: true
|
|
frequency_penalty:
|
|
type: number
|
|
nullable: true
|
|
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/ServiceTierEnum'
|
|
store:
|
|
type: boolean
|
|
truncation:
|
|
$ref: '#/components/schemas/TruncationEnum'
|
|
text:
|
|
$ref: '#/components/schemas/TextConfig'
|
|
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
|
|
OpenResponsesResult:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseResponsesResult'
|
|
- type: object
|
|
properties:
|
|
output:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/OutputItems'
|
|
usage:
|
|
$ref: '#/components/schemas/Usage'
|
|
service_tier:
|
|
type: string
|
|
nullable: true
|
|
description: Complete non-streaming response from the Responses API
|
|
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
|
|
CreatedEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.created
|
|
response:
|
|
$ref: '#/components/schemas/BaseResponsesResult'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- response
|
|
- sequence_number
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.in_progress
|
|
response:
|
|
$ref: '#/components/schemas/BaseResponsesResult'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- response
|
|
- sequence_number
|
|
description: Event emitted when a response is in progress
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.completed
|
|
response:
|
|
$ref: '#/components/schemas/BaseResponsesResult'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- response
|
|
- sequence_number
|
|
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:
|
|
- 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
|
|
IncompleteEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.incomplete
|
|
response:
|
|
$ref: '#/components/schemas/BaseResponsesResult'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- response
|
|
- 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
|
|
FailedEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.failed
|
|
response:
|
|
$ref: '#/components/schemas/BaseResponsesResult'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- response
|
|
- 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
|
|
BaseErrorEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
code:
|
|
type: string
|
|
nullable: true
|
|
message:
|
|
type: string
|
|
param:
|
|
type: string
|
|
nullable: true
|
|
sequence_number:
|
|
type: number
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.output_item.added
|
|
output_index:
|
|
type: number
|
|
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: number
|
|
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
|
|
OutputItemDoneEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.output_item.done
|
|
output_index:
|
|
type: number
|
|
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: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item
|
|
- 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
|
|
BaseContentPartAddedEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.content_part.added
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
part:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/ResponseOutputText'
|
|
- $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- part
|
|
- sequence_number
|
|
description: Event emitted when a new content part is added to an output item
|
|
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
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.content_part.done
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
part:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/ResponseOutputText'
|
|
- $ref: '#/components/schemas/OpenAIResponsesRefusalContent'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- 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:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
logprob:
|
|
type: number
|
|
bytes:
|
|
type: array
|
|
items:
|
|
type: number
|
|
description: Alternative token with its log probability
|
|
example:
|
|
token: hello
|
|
logprob: -0.5
|
|
OpenResponsesLogProbs:
|
|
type: object
|
|
properties:
|
|
logprob:
|
|
type: number
|
|
token:
|
|
type: string
|
|
top_logprobs:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/OpenResponsesTopLogprobs'
|
|
bytes:
|
|
type: array
|
|
items:
|
|
type: number
|
|
required:
|
|
- logprob
|
|
- token
|
|
description: Log probability information for a token
|
|
example:
|
|
logprob: -0.1
|
|
token: world
|
|
top_logprobs:
|
|
- token: hello
|
|
logprob: -0.5
|
|
BaseTextDeltaEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.output_text.delta
|
|
logprobs:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/OpenResponsesLogProbs'
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
delta:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- logprobs
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- delta
|
|
- sequence_number
|
|
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
|
|
TextDeltaEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseTextDeltaEvent'
|
|
- type: object
|
|
properties:
|
|
logprobs:
|
|
type: array
|
|
items:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenResponsesLogProbs'
|
|
- type: object
|
|
properties:
|
|
top_logprobs:
|
|
type: array
|
|
items:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenResponsesTopLogprobs'
|
|
- type: object
|
|
properties: {}
|
|
description: Alternative token with its log probability
|
|
example:
|
|
token: hello
|
|
logprob: -0.5
|
|
description: Log probability information for a token
|
|
example:
|
|
logprob: -0.1
|
|
token: world
|
|
top_logprobs:
|
|
- token: hello
|
|
logprob: -0.5
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.output_text.done
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
text:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
logprobs:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/OpenResponsesLogProbs'
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- text
|
|
- sequence_number
|
|
- logprobs
|
|
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: []
|
|
TextDoneEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseTextDoneEvent'
|
|
- type: object
|
|
properties:
|
|
logprobs:
|
|
type: array
|
|
items:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenResponsesLogProbs'
|
|
- type: object
|
|
properties:
|
|
top_logprobs:
|
|
type: array
|
|
items:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenResponsesTopLogprobs'
|
|
- type: object
|
|
properties: {}
|
|
description: Alternative token with its log probability
|
|
example:
|
|
token: hello
|
|
logprob: -0.5
|
|
description: Log probability information for a token
|
|
example:
|
|
logprob: -0.1
|
|
token: world
|
|
top_logprobs:
|
|
- token: hello
|
|
logprob: -0.5
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.refusal.delta
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
delta:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- delta
|
|
- sequence_number
|
|
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
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.refusal.done
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
refusal:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- refusal
|
|
- sequence_number
|
|
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
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.output_text.annotation.added
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
annotation_index:
|
|
type: number
|
|
annotation:
|
|
$ref: '#/components/schemas/OpenAIResponsesAnnotation'
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- sequence_number
|
|
- annotation_index
|
|
- annotation
|
|
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
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.function_call_arguments.delta
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
delta:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- delta
|
|
- 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": "San'
|
|
sequence_number: 4
|
|
FunctionCallArgsDeltaEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseFunctionCallArgsDeltaEvent'
|
|
- type: object
|
|
properties: {}
|
|
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": "San'
|
|
sequence_number: 4
|
|
BaseFunctionCallArgsDoneEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.function_call_arguments.done
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
name:
|
|
type: string
|
|
arguments:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- name
|
|
- arguments
|
|
- 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
|
|
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
|
|
BaseReasoningDeltaEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_text.delta
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
delta:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- delta
|
|
- 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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_text.done
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
content_index:
|
|
type: number
|
|
text:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- content_index
|
|
- text
|
|
- sequence_number
|
|
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.
|
|
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.
|
|
sequence_number: 6
|
|
BaseReasoningSummaryPartAddedEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_summary_part.added
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
summary_index:
|
|
type: number
|
|
part:
|
|
$ref: '#/components/schemas/ReasoningSummaryText'
|
|
sequence_number:
|
|
type: number
|
|
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:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_summary_part.done
|
|
output_index:
|
|
type: number
|
|
item_id:
|
|
type: string
|
|
summary_index:
|
|
type: number
|
|
part:
|
|
$ref: '#/components/schemas/ReasoningSummaryText'
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- output_index
|
|
- item_id
|
|
- summary_index
|
|
- part
|
|
- 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
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_summary_text.delta
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
summary_index:
|
|
type: number
|
|
delta:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
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
|
|
example:
|
|
type: response.reasoning_summary_text.delta
|
|
item_id: item-1
|
|
output_index: 0
|
|
summary_index: 0
|
|
delta: Analyzing
|
|
sequence_number: 4
|
|
BaseReasoningSummaryTextDoneEvent:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.reasoning_summary_text.done
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
summary_index:
|
|
type: number
|
|
text:
|
|
type: string
|
|
sequence_number:
|
|
type: number
|
|
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
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.image_generation_call.in_progress
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
ImageGenCallInProgressEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallInProgress'
|
|
- type: object
|
|
properties: {}
|
|
description: Image generation call in progress
|
|
example:
|
|
type: response.image_generation_call.in_progress
|
|
output_index: 0
|
|
sequence_number: 1
|
|
item_id: call-123
|
|
OpenAIResponsesImageGenCallGenerating:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.image_generation_call.generating
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
ImageGenCallGeneratingEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallGenerating'
|
|
- type: object
|
|
properties: {}
|
|
description: Image generation call is generating
|
|
example:
|
|
type: response.image_generation_call.generating
|
|
output_index: 0
|
|
sequence_number: 2
|
|
item_id: call-123
|
|
OpenAIResponsesImageGenCallPartialImage:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.image_generation_call.partial_image
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
partial_image_b64:
|
|
type: string
|
|
partial_image_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
- partial_image_b64
|
|
- partial_image_index
|
|
ImageGenCallPartialImageEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallPartialImage'
|
|
- type: object
|
|
properties: {}
|
|
description: Image generation call with partial image
|
|
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
|
|
OpenAIResponsesImageGenCallCompleted:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.image_generation_call.completed
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
ImageGenCallCompletedEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesImageGenCallCompleted'
|
|
- type: object
|
|
properties: {}
|
|
description: Image generation call completed
|
|
example:
|
|
type: response.image_generation_call.completed
|
|
output_index: 0
|
|
sequence_number: 4
|
|
item_id: call-123
|
|
OpenAIResponsesWebSearchCallInProgress:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.web_search_call.in_progress
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
WebSearchCallInProgressEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallInProgress'
|
|
- type: object
|
|
properties: {}
|
|
description: Web search call in progress
|
|
example:
|
|
type: response.web_search_call.in_progress
|
|
output_index: 0
|
|
sequence_number: 1
|
|
item_id: ws-123
|
|
OpenAIResponsesWebSearchCallSearching:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.web_search_call.searching
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
WebSearchCallSearchingEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesWebSearchCallSearching'
|
|
- type: object
|
|
properties: {}
|
|
description: Web search call is searching
|
|
example:
|
|
type: response.web_search_call.searching
|
|
output_index: 0
|
|
sequence_number: 2
|
|
item_id: ws-123
|
|
OpenAIResponsesSearchCompleted:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- response.web_search_call.completed
|
|
item_id:
|
|
type: string
|
|
output_index:
|
|
type: number
|
|
sequence_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- item_id
|
|
- output_index
|
|
- sequence_number
|
|
WebSearchCallCompletedEvent:
|
|
allOf:
|
|
- $ref: '#/components/schemas/OpenAIResponsesSearchCompleted'
|
|
- type: object
|
|
properties: {}
|
|
description: Web search call completed
|
|
example:
|
|
type: response.web_search_call.completed
|
|
output_index: 0
|
|
sequence_number: 3
|
|
item_id: ws-123
|
|
StreamEvents:
|
|
oneOf:
|
|
- 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
|
|
- allOf:
|
|
- $ref: '#/components/schemas/InProgressEvent'
|
|
- type: object
|
|
properties:
|
|
response:
|
|
$ref: '#/components/schemas/OpenResponsesResult'
|
|
description: Event emitted when a response is in progress
|
|
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
|
|
- 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:
|
|
- 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
|
|
- 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
|
|
- 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
|
|
- $ref: '#/components/schemas/ErrorEvent'
|
|
- 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
|
|
- allOf:
|
|
- $ref: '#/components/schemas/OutputItemDoneEvent'
|
|
- type: object
|
|
properties:
|
|
item:
|
|
$ref: '#/components/schemas/OutputItems'
|
|
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
|
|
- $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'
|
|
description: Union of all possible event types emitted during response streaming
|
|
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
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
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: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/BadRequestResponseErrorData'
|
|
user_id:
|
|
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
|
|
required:
|
|
- code
|
|
- message
|
|
description: Error data for UnauthorizedResponse
|
|
example:
|
|
code: 401
|
|
message: Missing Authentication header
|
|
UnauthorizedResponse:
|
|
type: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/UnauthorizedResponseErrorData'
|
|
user_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- error
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
example:
|
|
error:
|
|
code: 401
|
|
message: Missing Authentication header
|
|
PaymentRequiredResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
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:
|
|
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
|
|
example:
|
|
error:
|
|
code: 402
|
|
message: Insufficient credits. Add more using https://openrouter.ai/credits
|
|
NotFoundResponseErrorData:
|
|
type: object
|
|
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:
|
|
type: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/NotFoundResponseErrorData'
|
|
user_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- error
|
|
description: Not Found - Resource does not exist
|
|
example:
|
|
error:
|
|
code: 404
|
|
message: Resource not found
|
|
RequestTimeoutResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
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: 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: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
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: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/PayloadTooLargeResponseErrorData'
|
|
user_id:
|
|
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: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
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: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
nullable: true
|
|
required:
|
|
- code
|
|
- message
|
|
description: Error data for TooManyRequestsResponse
|
|
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
|
|
example:
|
|
error:
|
|
code: 429
|
|
message: Rate limit exceeded
|
|
InternalServerResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
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
|
|
nullable: true
|
|
required:
|
|
- error
|
|
description: Internal Server Error - Unexpected server error
|
|
example:
|
|
error:
|
|
code: 500
|
|
message: Internal Server Error
|
|
BadGatewayResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
nullable: true
|
|
required:
|
|
- code
|
|
- message
|
|
description: Error data for BadGatewayResponse
|
|
example:
|
|
code: 502
|
|
message: Provider returned error
|
|
BadGatewayResponse:
|
|
type: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/BadGatewayResponseErrorData'
|
|
user_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- error
|
|
description: Bad Gateway - Provider/upstream API failure
|
|
example:
|
|
error:
|
|
code: 502
|
|
message: Provider returned error
|
|
ServiceUnavailableResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
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
|
|
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
|
|
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: integer
|
|
message:
|
|
type: string
|
|
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
|
|
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
|
|
properties:
|
|
content:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/ReasoningTextContent'
|
|
signature:
|
|
type: string
|
|
nullable: true
|
|
format:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- unknown
|
|
- openai-responses-v1
|
|
- azure-openai-responses-v1
|
|
- xai-responses-v1
|
|
- anthropic-claude-v1
|
|
- google-gemini-v1
|
|
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
|
|
enum:
|
|
- input_video
|
|
video_url:
|
|
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:
|
|
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:
|
|
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.
|
|
example: final_answer
|
|
required:
|
|
- role
|
|
InputMessageItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message
|
|
role:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- user
|
|
- type: string
|
|
enum:
|
|
- system
|
|
- type: string
|
|
enum:
|
|
- developer
|
|
content:
|
|
type: array
|
|
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'
|
|
required:
|
|
- role
|
|
FunctionCallItem:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function_call
|
|
call_id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
arguments:
|
|
type: string
|
|
id:
|
|
type: string
|
|
status:
|
|
$ref: '#/components/schemas/ToolCallStatusEnum'
|
|
required:
|
|
- type
|
|
- call_id
|
|
- name
|
|
- arguments
|
|
- id
|
|
description: A function call initiated by the model
|
|
example:
|
|
id: call-abc123
|
|
type: function_call
|
|
call_id: call-abc123
|
|
name: get_weather
|
|
arguments: '{"location":"San Francisco"}'
|
|
status: completed
|
|
FunctionCallOutputItem:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function_call_output
|
|
id:
|
|
type: string
|
|
nullable: true
|
|
call_id:
|
|
type: string
|
|
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'
|
|
status:
|
|
$ref: '#/components/schemas/ToolCallStatusEnum'
|
|
required:
|
|
- type
|
|
- call_id
|
|
- output
|
|
description: The output from a function call execution
|
|
example:
|
|
type: function_call_output
|
|
id: output-abc123
|
|
call_id: call-abc123
|
|
output: '{"temperature":72,"conditions":"sunny"}'
|
|
status: completed
|
|
OutputDatetimeItem:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- openrouter:datetime
|
|
id:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum:
|
|
- completed
|
|
- in_progress
|
|
- incomplete
|
|
datetime:
|
|
type: string
|
|
description: ISO 8601 datetime string
|
|
timezone:
|
|
type: string
|
|
description: IANA timezone name
|
|
required:
|
|
- type
|
|
- status
|
|
- 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
|
|
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/OutputServerToolItem'
|
|
description: Input for a response request - can be a string or array of items
|
|
example:
|
|
- role: user
|
|
content: What is the weather today?
|
|
DatetimeServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- openrouter:datetime
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
timezone:
|
|
type: string
|
|
description: IANA timezone name (e.g. "America/New_York"). Defaults to UTC.
|
|
example: America/New_York
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- openrouter:web_search
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
description: Maximum number of search results to return per search call. Defaults to 5.
|
|
example: 5
|
|
max_total_results:
|
|
type: number
|
|
minimum: 1
|
|
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
|
|
example:
|
|
format:
|
|
type: text
|
|
verbosity: medium
|
|
ReasoningConfig:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseReasoningConfig'
|
|
- type: object
|
|
nullable: true
|
|
properties:
|
|
max_tokens:
|
|
type: number
|
|
nullable: true
|
|
enabled:
|
|
type: boolean
|
|
nullable: true
|
|
description: Configuration for reasoning mode in the response
|
|
example:
|
|
summary: auto
|
|
enabled: true
|
|
OutputModalityEnum:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
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
|
|
OpenAIResponsesTruncation:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- auto
|
|
- disabled
|
|
example: auto
|
|
DataCollection:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- deny
|
|
- 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.
|
|
example: allow
|
|
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:
|
|
type: object
|
|
properties:
|
|
by:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- price
|
|
- throughput
|
|
- latency
|
|
- exacto
|
|
description: The provider sorting strategy (price, throughput, latency)
|
|
example: price
|
|
partition:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- model
|
|
- none
|
|
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)
|
|
example:
|
|
by: price
|
|
partition: model
|
|
BigNumberUnion:
|
|
type: string
|
|
description: Price per million prompt tokens
|
|
example: 1000
|
|
PercentileThroughputCutoffs:
|
|
type: object
|
|
properties:
|
|
p50:
|
|
type: number
|
|
nullable: true
|
|
description: Minimum p50 throughput (tokens/sec)
|
|
p75:
|
|
type: number
|
|
nullable: true
|
|
description: Minimum p75 throughput (tokens/sec)
|
|
p90:
|
|
type: number
|
|
nullable: true
|
|
description: Minimum p90 throughput (tokens/sec)
|
|
p99:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
- $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:
|
|
type: object
|
|
properties:
|
|
p50:
|
|
type: number
|
|
nullable: true
|
|
description: Maximum p50 latency (seconds)
|
|
p75:
|
|
type: number
|
|
nullable: true
|
|
description: Maximum p75 latency (seconds)
|
|
p90:
|
|
type: number
|
|
nullable: true
|
|
description: Maximum p90 latency (seconds)
|
|
p99:
|
|
type: number
|
|
nullable: true
|
|
description: Maximum p99 latency (seconds)
|
|
description: Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
|
|
example:
|
|
p50: 5
|
|
p90: 10
|
|
PreferredMaxLatency:
|
|
anyOf:
|
|
- 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
|
|
WebSearchEngine:
|
|
type: string
|
|
enum:
|
|
- native
|
|
- exa
|
|
- firecrawl
|
|
- parallel
|
|
description: The search engine to use for web search.
|
|
PDFParserEngine:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- mistral-ocr
|
|
- native
|
|
- cloudflare-ai
|
|
- type: string
|
|
enum:
|
|
- pdf-text
|
|
description: >-
|
|
The engine to use for parsing PDF files. "pdf-text" is deprecated and automatically redirected to
|
|
"cloudflare-ai".
|
|
PDFParserOptions:
|
|
type: object
|
|
properties:
|
|
engine:
|
|
$ref: '#/components/schemas/PDFParserEngine'
|
|
description: Options for PDF parsing.
|
|
ContextCompressionEngine:
|
|
type: string
|
|
enum:
|
|
- middle-out
|
|
description: The compression engine to use. Defaults to "middle-out".
|
|
ResponsesRequest:
|
|
type: object
|
|
properties:
|
|
input:
|
|
$ref: '#/components/schemas/Inputs'
|
|
instructions:
|
|
type: string
|
|
nullable: true
|
|
metadata:
|
|
$ref: '#/components/schemas/RequestMetadata'
|
|
tools:
|
|
type: array
|
|
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
|
|
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: number
|
|
nullable: true
|
|
temperature:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 2
|
|
top_p:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
top_logprobs:
|
|
type: integer
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 20
|
|
max_tool_calls:
|
|
type: integer
|
|
nullable: true
|
|
presence_penalty:
|
|
type: number
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
frequency_penalty:
|
|
type: number
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
top_k:
|
|
type: number
|
|
image_config:
|
|
type: object
|
|
additionalProperties:
|
|
anyOf:
|
|
- type: string
|
|
- 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'
|
|
modalities:
|
|
type: array
|
|
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
|
|
nullable: true
|
|
prompt:
|
|
$ref: '#/components/schemas/StoredPromptTemplate'
|
|
include:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/ResponseIncludesEnum'
|
|
background:
|
|
type: boolean
|
|
nullable: true
|
|
safety_identifier:
|
|
type: string
|
|
nullable: true
|
|
store:
|
|
type: boolean
|
|
const: false
|
|
default: false
|
|
service_tier:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- auto
|
|
- default
|
|
- flex
|
|
- priority
|
|
- scale
|
|
default: auto
|
|
truncation:
|
|
$ref: '#/components/schemas/OpenAIResponsesTruncation'
|
|
stream:
|
|
type: boolean
|
|
default: false
|
|
provider:
|
|
type: object
|
|
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:
|
|
$ref: '#/components/schemas/DataCollection'
|
|
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
|
|
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.
|
|
only:
|
|
type: array
|
|
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.
|
|
ignore:
|
|
type: array
|
|
nullable: true
|
|
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.
|
|
quantizations:
|
|
type: array
|
|
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
|
|
description: When multiple model providers are available, optionally indicate your routing preference.
|
|
plugins:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
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/*
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- moderation
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- web
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
max_results:
|
|
type: number
|
|
search_prompt:
|
|
type: string
|
|
engine:
|
|
$ref: '#/components/schemas/WebSearchEngine'
|
|
include_domains:
|
|
type: array
|
|
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
|
|
items:
|
|
type: string
|
|
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
|
|
- type: object
|
|
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'
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- response-healing
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
required:
|
|
- id
|
|
- type: object
|
|
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.
|
|
engine:
|
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
|
required:
|
|
- id
|
|
description: Plugins you want to enable for this request, including their settings.
|
|
route:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fallback
|
|
- sort
|
|
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").
|
|
x-speakeasy-deprecation-message: Use providers.sort.partition instead.
|
|
x-speakeasy-ignore: true
|
|
x-fern-ignore: true
|
|
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:
|
|
type: object
|
|
properties:
|
|
trace_id:
|
|
type: string
|
|
trace_name:
|
|
type: string
|
|
span_name:
|
|
type: string
|
|
generation_name:
|
|
type: string
|
|
parent_span_id:
|
|
type: string
|
|
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.
|
|
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
|
|
BaseMessagesResult:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message
|
|
role:
|
|
type: string
|
|
enum:
|
|
- assistant
|
|
container:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
id:
|
|
type: string
|
|
expires_at:
|
|
type: string
|
|
required:
|
|
- id
|
|
- expires_at
|
|
content:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- file_id
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
required:
|
|
- type
|
|
- text
|
|
- citations
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_use
|
|
id:
|
|
type: string
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking
|
|
thinking:
|
|
type: string
|
|
signature:
|
|
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
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
- web_fetch
|
|
- code_execution
|
|
- bash_code_execution
|
|
- text_editor_code_execution
|
|
- tool_search_tool_regex
|
|
- tool_search_tool_bm25
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
tool_use_id:
|
|
type: string
|
|
content:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_result
|
|
encrypted_content:
|
|
type: string
|
|
page_age:
|
|
type: string
|
|
nullable: true
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- encrypted_content
|
|
- page_age
|
|
- title
|
|
- url
|
|
- 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
|
|
- request_too_large
|
|
required:
|
|
- type
|
|
- error_code
|
|
required:
|
|
- type
|
|
- caller
|
|
- tool_use_id
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result_error
|
|
error_code:
|
|
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
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: object
|
|
properties:
|
|
citations:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
required:
|
|
- enabled
|
|
source:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- application/pdf
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- text/plain
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- document
|
|
required:
|
|
- citations
|
|
- source
|
|
- title
|
|
- type
|
|
retrieved_at:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_result
|
|
url:
|
|
type: string
|
|
required:
|
|
- content
|
|
- retrieved_at
|
|
- type
|
|
- url
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- caller
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
encrypted_stdout:
|
|
type: string
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- encrypted_code_execution_result
|
|
required:
|
|
- content
|
|
- encrypted_stdout
|
|
- return_code
|
|
- stderr
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- output_file_too_large
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- file_not_found
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: string
|
|
file_type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
- pdf
|
|
num_lines:
|
|
type: number
|
|
nullable: true
|
|
start_line:
|
|
type: number
|
|
nullable: true
|
|
total_lines:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_view_result
|
|
required:
|
|
- content
|
|
- file_type
|
|
- num_lines
|
|
- start_line
|
|
- total_lines
|
|
- type
|
|
- type: object
|
|
properties:
|
|
is_file_update:
|
|
type: boolean
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_create_result
|
|
required:
|
|
- is_file_update
|
|
- type
|
|
- type: object
|
|
properties:
|
|
lines:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
new_lines:
|
|
type: number
|
|
nullable: true
|
|
new_start:
|
|
type: number
|
|
nullable: true
|
|
old_lines:
|
|
type: number
|
|
nullable: true
|
|
old_start:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_str_replace_result
|
|
required:
|
|
- lines
|
|
- new_lines
|
|
- new_start
|
|
- old_lines
|
|
- old_start
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
tool_references:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
tool_name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_reference
|
|
required:
|
|
- tool_name
|
|
- type
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_search_result
|
|
required:
|
|
- tool_references
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- container_upload
|
|
file_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- file_id
|
|
model:
|
|
type: string
|
|
stop_reason:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- end_turn
|
|
- max_tokens
|
|
- stop_sequence
|
|
- tool_use
|
|
- pause_turn
|
|
- refusal
|
|
stop_sequence:
|
|
type: string
|
|
nullable: true
|
|
usage:
|
|
type: object
|
|
properties:
|
|
input_tokens:
|
|
type: number
|
|
output_tokens:
|
|
type: number
|
|
cache_creation_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_read_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_creation:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
ephemeral_5m_input_tokens:
|
|
type: number
|
|
ephemeral_1h_input_tokens:
|
|
type: number
|
|
required:
|
|
- ephemeral_5m_input_tokens
|
|
- ephemeral_1h_input_tokens
|
|
inference_geo:
|
|
type: string
|
|
nullable: true
|
|
server_tool_use:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
web_search_requests:
|
|
type: number
|
|
web_fetch_requests:
|
|
type: number
|
|
required:
|
|
- web_search_requests
|
|
- web_fetch_requests
|
|
service_tier:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- standard
|
|
- priority
|
|
- batch
|
|
speed:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fast
|
|
- standard
|
|
required:
|
|
- input_tokens
|
|
- output_tokens
|
|
- cache_creation_input_tokens
|
|
- cache_read_input_tokens
|
|
- cache_creation
|
|
- inference_geo
|
|
- server_tool_use
|
|
- service_tier
|
|
required:
|
|
- id
|
|
- type
|
|
- role
|
|
- container
|
|
- content
|
|
- model
|
|
- stop_reason
|
|
- stop_sequence
|
|
- usage
|
|
MessagesResult:
|
|
allOf:
|
|
- $ref: '#/components/schemas/BaseMessagesResult'
|
|
- type: object
|
|
properties:
|
|
usage:
|
|
type: object
|
|
properties:
|
|
input_tokens:
|
|
type: number
|
|
output_tokens:
|
|
type: number
|
|
cache_creation_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_read_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_creation:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
ephemeral_5m_input_tokens:
|
|
type: number
|
|
ephemeral_1h_input_tokens:
|
|
type: number
|
|
required:
|
|
- ephemeral_5m_input_tokens
|
|
- ephemeral_1h_input_tokens
|
|
inference_geo:
|
|
type: string
|
|
nullable: true
|
|
server_tool_use:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
web_search_requests:
|
|
type: number
|
|
web_fetch_requests:
|
|
type: number
|
|
required:
|
|
- web_search_requests
|
|
- web_fetch_requests
|
|
service_tier:
|
|
type: string
|
|
nullable: true
|
|
speed:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fast
|
|
- standard
|
|
cost:
|
|
type: number
|
|
nullable: true
|
|
is_byok:
|
|
type: boolean
|
|
cost_details:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
upstream_inference_cost:
|
|
type: number
|
|
nullable: true
|
|
upstream_inference_prompt_cost:
|
|
type: number
|
|
upstream_inference_completions_cost:
|
|
type: number
|
|
required:
|
|
- upstream_inference_prompt_cost
|
|
- upstream_inference_completions_cost
|
|
required:
|
|
- input_tokens
|
|
- output_tokens
|
|
- cache_creation_input_tokens
|
|
- cache_read_input_tokens
|
|
- cache_creation
|
|
- inference_geo
|
|
- server_tool_use
|
|
- service_tier
|
|
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
|
|
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: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message_start
|
|
message:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message
|
|
role:
|
|
type: string
|
|
enum:
|
|
- assistant
|
|
container:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
id:
|
|
type: string
|
|
expires_at:
|
|
type: string
|
|
required:
|
|
- id
|
|
- expires_at
|
|
content:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- file_id
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
required:
|
|
- type
|
|
- text
|
|
- citations
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_use
|
|
id:
|
|
type: string
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking
|
|
thinking:
|
|
type: string
|
|
signature:
|
|
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
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
- web_fetch
|
|
- code_execution
|
|
- bash_code_execution
|
|
- text_editor_code_execution
|
|
- tool_search_tool_regex
|
|
- tool_search_tool_bm25
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
tool_use_id:
|
|
type: string
|
|
content:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_result
|
|
encrypted_content:
|
|
type: string
|
|
page_age:
|
|
type: string
|
|
nullable: true
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- encrypted_content
|
|
- page_age
|
|
- title
|
|
- url
|
|
- 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
|
|
- request_too_large
|
|
required:
|
|
- type
|
|
- error_code
|
|
required:
|
|
- type
|
|
- caller
|
|
- tool_use_id
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result_error
|
|
error_code:
|
|
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
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: object
|
|
properties:
|
|
citations:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
required:
|
|
- enabled
|
|
source:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- application/pdf
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- text/plain
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- document
|
|
required:
|
|
- citations
|
|
- source
|
|
- title
|
|
- type
|
|
retrieved_at:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_result
|
|
url:
|
|
type: string
|
|
required:
|
|
- content
|
|
- retrieved_at
|
|
- type
|
|
- url
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- caller
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
encrypted_stdout:
|
|
type: string
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- encrypted_code_execution_result
|
|
required:
|
|
- content
|
|
- encrypted_stdout
|
|
- return_code
|
|
- stderr
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- output_file_too_large
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- file_not_found
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: string
|
|
file_type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
- pdf
|
|
num_lines:
|
|
type: number
|
|
nullable: true
|
|
start_line:
|
|
type: number
|
|
nullable: true
|
|
total_lines:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_view_result
|
|
required:
|
|
- content
|
|
- file_type
|
|
- num_lines
|
|
- start_line
|
|
- total_lines
|
|
- type
|
|
- type: object
|
|
properties:
|
|
is_file_update:
|
|
type: boolean
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_create_result
|
|
required:
|
|
- is_file_update
|
|
- type
|
|
- type: object
|
|
properties:
|
|
lines:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
new_lines:
|
|
type: number
|
|
nullable: true
|
|
new_start:
|
|
type: number
|
|
nullable: true
|
|
old_lines:
|
|
type: number
|
|
nullable: true
|
|
old_start:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_str_replace_result
|
|
required:
|
|
- lines
|
|
- new_lines
|
|
- new_start
|
|
- old_lines
|
|
- old_start
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
tool_references:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
tool_name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_reference
|
|
required:
|
|
- tool_name
|
|
- type
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_search_result
|
|
required:
|
|
- tool_references
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- container_upload
|
|
file_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- file_id
|
|
model:
|
|
type: string
|
|
stop_reason:
|
|
nullable: true
|
|
stop_sequence:
|
|
nullable: true
|
|
usage:
|
|
type: object
|
|
properties:
|
|
input_tokens:
|
|
type: number
|
|
output_tokens:
|
|
type: number
|
|
cache_creation_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_read_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_creation:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
ephemeral_5m_input_tokens:
|
|
type: number
|
|
ephemeral_1h_input_tokens:
|
|
type: number
|
|
required:
|
|
- ephemeral_5m_input_tokens
|
|
- ephemeral_1h_input_tokens
|
|
inference_geo:
|
|
type: string
|
|
nullable: true
|
|
server_tool_use:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
web_search_requests:
|
|
type: number
|
|
web_fetch_requests:
|
|
type: number
|
|
required:
|
|
- web_search_requests
|
|
- web_fetch_requests
|
|
service_tier:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- standard
|
|
- priority
|
|
- batch
|
|
speed:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fast
|
|
- standard
|
|
required:
|
|
- input_tokens
|
|
- output_tokens
|
|
- cache_creation_input_tokens
|
|
- cache_read_input_tokens
|
|
- cache_creation
|
|
- inference_geo
|
|
- server_tool_use
|
|
- service_tier
|
|
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
|
|
MessagesStreamEvents:
|
|
oneOf:
|
|
- $ref: '#/components/schemas/MessagesStartEvent'
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message_delta
|
|
delta:
|
|
type: object
|
|
properties:
|
|
container:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
id:
|
|
type: string
|
|
expires_at:
|
|
type: string
|
|
required:
|
|
- id
|
|
- expires_at
|
|
stop_reason:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- end_turn
|
|
- max_tokens
|
|
- stop_sequence
|
|
- tool_use
|
|
- pause_turn
|
|
- refusal
|
|
stop_sequence:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- container
|
|
- stop_reason
|
|
- stop_sequence
|
|
usage:
|
|
type: object
|
|
properties:
|
|
input_tokens:
|
|
type: number
|
|
nullable: true
|
|
output_tokens:
|
|
type: number
|
|
cache_creation_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
cache_read_input_tokens:
|
|
type: number
|
|
nullable: true
|
|
server_tool_use:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
web_search_requests:
|
|
type: number
|
|
web_fetch_requests:
|
|
type: number
|
|
required:
|
|
- web_search_requests
|
|
- web_fetch_requests
|
|
required:
|
|
- input_tokens
|
|
- output_tokens
|
|
- cache_creation_input_tokens
|
|
- cache_read_input_tokens
|
|
- server_tool_use
|
|
required:
|
|
- type
|
|
- delta
|
|
- usage
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- message_stop
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_start
|
|
index:
|
|
type: number
|
|
content_block:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- file_id
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
required:
|
|
- type
|
|
- text
|
|
- citations
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_use
|
|
id:
|
|
type: string
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking
|
|
thinking:
|
|
type: string
|
|
signature:
|
|
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
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
name:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
- web_fetch
|
|
- code_execution
|
|
- bash_code_execution
|
|
- text_editor_code_execution
|
|
- tool_search_tool_regex
|
|
- tool_search_tool_bm25
|
|
input:
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- id
|
|
- caller
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
tool_use_id:
|
|
type: string
|
|
content:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_result
|
|
encrypted_content:
|
|
type: string
|
|
page_age:
|
|
type: string
|
|
nullable: true
|
|
title:
|
|
type: string
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- encrypted_content
|
|
- page_age
|
|
- title
|
|
- url
|
|
- 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
|
|
- request_too_large
|
|
required:
|
|
- type
|
|
- error_code
|
|
required:
|
|
- type
|
|
- caller
|
|
- tool_use_id
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result
|
|
caller:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20250825
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_20260120
|
|
tool_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_id
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_tool_result_error
|
|
error_code:
|
|
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
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: object
|
|
properties:
|
|
citations:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
required:
|
|
- enabled
|
|
source:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- application/pdf
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
- type: object
|
|
properties:
|
|
data:
|
|
type: string
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- text/plain
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
required:
|
|
- data
|
|
- media_type
|
|
- type
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- document
|
|
required:
|
|
- citations
|
|
- source
|
|
- title
|
|
- type
|
|
retrieved_at:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_fetch_result
|
|
url:
|
|
type: string
|
|
required:
|
|
- content
|
|
- retrieved_at
|
|
- type
|
|
- url
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- caller
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
encrypted_stdout:
|
|
type: string
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- encrypted_code_execution_result
|
|
required:
|
|
- content
|
|
- encrypted_stdout
|
|
- return_code
|
|
- stderr
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- output_file_too_large
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
file_id:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_output
|
|
required:
|
|
- file_id
|
|
- type
|
|
return_code:
|
|
type: number
|
|
stderr:
|
|
type: string
|
|
stdout:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_code_execution_result
|
|
required:
|
|
- content
|
|
- return_code
|
|
- stderr
|
|
- stdout
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
- file_not_found
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
content:
|
|
type: string
|
|
file_type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
- pdf
|
|
num_lines:
|
|
type: number
|
|
nullable: true
|
|
start_line:
|
|
type: number
|
|
nullable: true
|
|
total_lines:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_view_result
|
|
required:
|
|
- content
|
|
- file_type
|
|
- num_lines
|
|
- start_line
|
|
- total_lines
|
|
- type
|
|
- type: object
|
|
properties:
|
|
is_file_update:
|
|
type: boolean
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_create_result
|
|
required:
|
|
- is_file_update
|
|
- type
|
|
- type: object
|
|
properties:
|
|
lines:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
new_lines:
|
|
type: number
|
|
nullable: true
|
|
new_start:
|
|
type: number
|
|
nullable: true
|
|
old_lines:
|
|
type: number
|
|
nullable: true
|
|
old_start:
|
|
type: number
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_code_execution_str_replace_result
|
|
required:
|
|
- lines
|
|
- new_lines
|
|
- new_start
|
|
- old_lines
|
|
- old_start
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result
|
|
content:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
error_code:
|
|
type: string
|
|
enum:
|
|
- invalid_tool_input
|
|
- unavailable
|
|
- too_many_requests
|
|
- execution_time_exceeded
|
|
error_message:
|
|
type: string
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_result_error
|
|
required:
|
|
- error_code
|
|
- error_message
|
|
- type
|
|
- type: object
|
|
properties:
|
|
tool_references:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
tool_name:
|
|
type: string
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_reference
|
|
required:
|
|
- tool_name
|
|
- type
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_search_tool_search_result
|
|
required:
|
|
- tool_references
|
|
- type
|
|
tool_use_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- content
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- container_upload
|
|
file_id:
|
|
type: string
|
|
required:
|
|
- type
|
|
- file_id
|
|
required:
|
|
- type
|
|
- index
|
|
- content_block
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_delta
|
|
index:
|
|
type: number
|
|
delta:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_delta
|
|
text:
|
|
type: string
|
|
required:
|
|
- type
|
|
- text
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_json_delta
|
|
partial_json:
|
|
type: string
|
|
required:
|
|
- type
|
|
- partial_json
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking_delta
|
|
thinking:
|
|
type: string
|
|
required:
|
|
- type
|
|
- thinking
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- signature_delta
|
|
signature:
|
|
type: string
|
|
required:
|
|
- type
|
|
- signature
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- citations_delta
|
|
citation:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- file_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
file_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- file_id
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
required:
|
|
- type
|
|
- citation
|
|
required:
|
|
- type
|
|
- index
|
|
- delta
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_stop
|
|
index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ping
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
description: Union of all possible streaming events
|
|
MessagesMessageParam:
|
|
type: object
|
|
properties:
|
|
role:
|
|
type: string
|
|
enum:
|
|
- user
|
|
- assistant
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- image/jpeg
|
|
- image/png
|
|
- image/gif
|
|
- image/webp
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- document
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- application/pdf
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- text/plain
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- image/jpeg
|
|
- image/png
|
|
- image/gif
|
|
- image/webp
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
required:
|
|
- type
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
citations:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
context:
|
|
type: string
|
|
nullable: true
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_use
|
|
id:
|
|
type: string
|
|
name:
|
|
type: string
|
|
input:
|
|
nullable: true
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- id
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_result
|
|
tool_use_id:
|
|
type: string
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- image/jpeg
|
|
- image/png
|
|
- image/gif
|
|
- image/webp
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_reference
|
|
tool_name:
|
|
type: string
|
|
required:
|
|
- type
|
|
- tool_name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
citations:
|
|
type: object
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
- title
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- document
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- application/pdf
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- text/plain
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- image
|
|
source:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- base64
|
|
media_type:
|
|
type: string
|
|
enum:
|
|
- image/jpeg
|
|
- image/png
|
|
- image/gif
|
|
- image/webp
|
|
data:
|
|
type: string
|
|
required:
|
|
- type
|
|
- media_type
|
|
- data
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
required:
|
|
- type
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- url
|
|
url:
|
|
type: string
|
|
required:
|
|
- type
|
|
- url
|
|
citations:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
context:
|
|
type: string
|
|
nullable: true
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
is_error:
|
|
type: boolean
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- tool_use_id
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking
|
|
thinking:
|
|
type: string
|
|
signature:
|
|
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:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
- web_fetch
|
|
- code_execution
|
|
- bash_code_execution
|
|
- text_editor_code_execution
|
|
- tool_search_tool_regex
|
|
- tool_search_tool_bm25
|
|
input:
|
|
nullable: true
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
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:
|
|
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
|
|
- 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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- tool_use_id
|
|
- content
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
content:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
citations:
|
|
type: object
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- source
|
|
- title
|
|
- content
|
|
required:
|
|
- role
|
|
- content
|
|
description: Anthropic message with OpenRouter extensions
|
|
MessagesWebSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- openrouter:web_search
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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: number
|
|
minimum: 1
|
|
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:
|
|
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.
|
|
user_location:
|
|
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.
|
|
allowed_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Limit search results to these domains. Applies to Exa and Parallel engines. Not supported with Firecrawl
|
|
or native provider search.
|
|
excluded_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Exclude search results from these domains. Applies to Exa and Parallel engines. Not supported with
|
|
Firecrawl or native provider search.
|
|
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
|
|
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
|
|
nullable: true
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- json_schema
|
|
schema:
|
|
type: object
|
|
additionalProperties:
|
|
nullable: true
|
|
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.
|
|
MessagesRequest:
|
|
type: object
|
|
properties:
|
|
model:
|
|
type: string
|
|
max_tokens:
|
|
type: number
|
|
messages:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/MessagesMessageParam'
|
|
system:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
type: string
|
|
citations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- char_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_char_index:
|
|
type: number
|
|
end_char_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_char_index
|
|
- end_char_index
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- page_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_page_number:
|
|
type: number
|
|
end_page_number:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_page_number
|
|
- end_page_number
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- content_block_location
|
|
cited_text:
|
|
type: string
|
|
document_index:
|
|
type: number
|
|
document_title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- document_index
|
|
- document_title
|
|
- start_block_index
|
|
- end_block_index
|
|
- type: object
|
|
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
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- encrypted_index
|
|
- title
|
|
- url
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- search_result_location
|
|
cited_text:
|
|
type: string
|
|
search_result_index:
|
|
type: number
|
|
source:
|
|
type: string
|
|
title:
|
|
type: string
|
|
nullable: true
|
|
start_block_index:
|
|
type: number
|
|
end_block_index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- cited_text
|
|
- search_result_index
|
|
- source
|
|
- title
|
|
- start_block_index
|
|
- end_block_index
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- text
|
|
metadata:
|
|
type: object
|
|
properties:
|
|
user_id:
|
|
type: string
|
|
nullable: true
|
|
stop_sequences:
|
|
type: array
|
|
items:
|
|
type: string
|
|
temperature:
|
|
type: number
|
|
top_p:
|
|
type: number
|
|
top_k:
|
|
type: number
|
|
tools:
|
|
type: array
|
|
items:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
description:
|
|
type: string
|
|
input_schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
default: object
|
|
properties:
|
|
nullable: true
|
|
required:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
additionalProperties:
|
|
nullable: true
|
|
type:
|
|
type: string
|
|
enum:
|
|
- custom
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- name
|
|
- input_schema
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- bash_20250124
|
|
name:
|
|
type: string
|
|
enum:
|
|
- bash
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text_editor_20250124
|
|
name:
|
|
type: string
|
|
enum:
|
|
- str_replace_editor
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_20250305
|
|
name:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
blocked_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
max_uses:
|
|
type: number
|
|
nullable: true
|
|
user_location:
|
|
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
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- name
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search_20260209
|
|
name:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
allowed_callers:
|
|
type: array
|
|
items:
|
|
type: string
|
|
enum:
|
|
- direct
|
|
- code_execution_20250825
|
|
- code_execution_20260120
|
|
allowed_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
blocked_domains:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
max_uses:
|
|
type: number
|
|
nullable: true
|
|
user_location:
|
|
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
|
|
cache_control:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
required:
|
|
- type
|
|
- name
|
|
- $ref: '#/components/schemas/DatetimeServerTool'
|
|
- $ref: '#/components/schemas/MessagesWebSearchServerTool'
|
|
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: number
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
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:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_tokens
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
clear_tool_inputs:
|
|
anyOf:
|
|
- type: boolean
|
|
- type: array
|
|
items:
|
|
type: string
|
|
- nullable: true
|
|
exclude_tools:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
keep:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_uses
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
trigger:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_tokens
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- tool_uses
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
required:
|
|
- type
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- clear_thinking_20251015
|
|
keep:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- thinking_turns
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
- 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:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- input_tokens
|
|
value:
|
|
type: number
|
|
required:
|
|
- type
|
|
- value
|
|
required:
|
|
- type
|
|
provider:
|
|
type: object
|
|
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:
|
|
$ref: '#/components/schemas/DataCollection'
|
|
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
|
|
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.
|
|
only:
|
|
type: array
|
|
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.
|
|
ignore:
|
|
type: array
|
|
nullable: true
|
|
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.
|
|
quantizations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/Quantization'
|
|
description: A list of quantization levels to filter the provider by.
|
|
sort:
|
|
allOf:
|
|
- $ref: '#/components/schemas/ProviderSort'
|
|
- 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.
|
|
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
|
|
description: When multiple model providers are available, optionally indicate your routing preference.
|
|
plugins:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
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/*
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- moderation
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- web
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
max_results:
|
|
type: number
|
|
search_prompt:
|
|
type: string
|
|
engine:
|
|
$ref: '#/components/schemas/WebSearchEngine'
|
|
include_domains:
|
|
type: array
|
|
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
|
|
items:
|
|
type: string
|
|
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
|
|
- type: object
|
|
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'
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- response-healing
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
required:
|
|
- id
|
|
- type: object
|
|
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.
|
|
engine:
|
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
|
required:
|
|
- id
|
|
description: Plugins you want to enable for this request, including their settings.
|
|
route:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fallback
|
|
- sort
|
|
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").
|
|
x-speakeasy-deprecation-message: Use providers.sort.partition instead.
|
|
x-speakeasy-ignore: true
|
|
x-fern-ignore: true
|
|
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:
|
|
type: object
|
|
properties:
|
|
trace_id:
|
|
type: string
|
|
trace_name:
|
|
type: string
|
|
span_name:
|
|
type: string
|
|
generation_name:
|
|
type: string
|
|
parent_span_id:
|
|
type: string
|
|
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.
|
|
models:
|
|
type: array
|
|
items:
|
|
type: string
|
|
speed:
|
|
type: string
|
|
enum:
|
|
- fast
|
|
- standard
|
|
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
|
|
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
|
|
usage:
|
|
type: number
|
|
description: Total cost in USD (OpenRouter credits spent)
|
|
example: 0.015
|
|
byok_usage_inference:
|
|
type: number
|
|
description: BYOK inference cost in USD (external credits spent)
|
|
example: 0.012
|
|
requests:
|
|
type: number
|
|
description: Number of requests made
|
|
example: 5
|
|
prompt_tokens:
|
|
type: number
|
|
description: Total prompt tokens used
|
|
example: 50
|
|
completion_tokens:
|
|
type: number
|
|
description: Total completion tokens generated
|
|
example: 125
|
|
reasoning_tokens:
|
|
type: number
|
|
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
|
|
ForbiddenResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
nullable: true
|
|
required:
|
|
- code
|
|
- 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
|
|
enum:
|
|
- tool_calls
|
|
- stop
|
|
- length
|
|
- content_filter
|
|
- error
|
|
example: stop
|
|
ChatContentCacheControl:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
description: Cache control for the content part
|
|
example:
|
|
type: ephemeral
|
|
ttl: 5m
|
|
ChatContentText:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
text:
|
|
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
|
|
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.
|
|
example:
|
|
type: input_audio
|
|
input_audio:
|
|
data: SGVsbG8gV29ybGQ=
|
|
format: wav
|
|
Legacy_ChatContentVideo:
|
|
type: object
|
|
properties:
|
|
type:
|
|
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:
|
|
type: string
|
|
description: 'URL of the video (data: URLs supported)'
|
|
required:
|
|
- url
|
|
description: Video input object
|
|
ChatContentVideo:
|
|
type: object
|
|
properties:
|
|
type:
|
|
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:
|
|
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'
|
|
- oneOf:
|
|
- $ref: '#/components/schemas/Legacy_ChatContentVideo'
|
|
- $ref: '#/components/schemas/ChatContentVideo'
|
|
discriminator:
|
|
propertyName: type
|
|
mapping:
|
|
input_video: '#/components/schemas/Legacy_ChatContentVideo'
|
|
video_url: '#/components/schemas/ChatContentVideo'
|
|
- $ref: '#/components/schemas/ChatContentFile'
|
|
discriminator:
|
|
propertyName: type
|
|
description: Content part for chat completion messages
|
|
example:
|
|
type: text
|
|
text: Hello, world!
|
|
ChatToolCall:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: Tool call identifier
|
|
type:
|
|
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
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- reasoning.summary
|
|
summary:
|
|
type: string
|
|
id:
|
|
type: string
|
|
nullable: true
|
|
format:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- unknown
|
|
- openai-responses-v1
|
|
- azure-openai-responses-v1
|
|
- xai-responses-v1
|
|
- anthropic-claude-v1
|
|
- google-gemini-v1
|
|
index:
|
|
type: number
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- reasoning.encrypted
|
|
data:
|
|
type: string
|
|
id:
|
|
type: string
|
|
nullable: true
|
|
format:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- unknown
|
|
- openai-responses-v1
|
|
- azure-openai-responses-v1
|
|
- xai-responses-v1
|
|
- anthropic-claude-v1
|
|
- google-gemini-v1
|
|
index:
|
|
type: number
|
|
required:
|
|
- type
|
|
- data
|
|
description: Reasoning detail encrypted schema
|
|
example:
|
|
type: reasoning.encrypted
|
|
data: encrypted data
|
|
ReasoningDetailText:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- reasoning.text
|
|
text:
|
|
type: string
|
|
nullable: true
|
|
signature:
|
|
type: string
|
|
nullable: true
|
|
id:
|
|
type: string
|
|
nullable: true
|
|
format:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- unknown
|
|
- openai-responses-v1
|
|
- azure-openai-responses-v1
|
|
- xai-responses-v1
|
|
- anthropic-claude-v1
|
|
- google-gemini-v1
|
|
index:
|
|
type: number
|
|
required:
|
|
- type
|
|
description: Reasoning detail text schema
|
|
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
|
|
example:
|
|
type: reasoning.summary
|
|
summary: The model analyzed the problem by first identifying key constraints, then evaluating possible solutions...
|
|
ChatReasoningDetails:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/ReasoningDetailUnion'
|
|
description: Reasoning details for extended thinking models
|
|
ChatAssistantImages:
|
|
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
|
|
example:
|
|
- image_url:
|
|
url: data:image/png;base64,iVBORw0KGgo...
|
|
ChatAudioOutput:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: Audio output identifier
|
|
expires_at:
|
|
type: number
|
|
description: Audio expiration timestamp
|
|
data:
|
|
type: string
|
|
description: Base64 encoded audio data
|
|
transcript:
|
|
type: string
|
|
description: Audio transcript
|
|
description: Audio output data or reference
|
|
example:
|
|
id: audio_abc123
|
|
expires_at: 1677652400
|
|
data: UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1f
|
|
transcript: Hello! How can I help you today?
|
|
ChatAssistantMessage:
|
|
type: object
|
|
properties:
|
|
role:
|
|
type: string
|
|
enum:
|
|
- assistant
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
$ref: '#/components/schemas/ChatContentItems'
|
|
- nullable: true
|
|
description: Assistant message content
|
|
name:
|
|
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:
|
|
type: string
|
|
nullable: true
|
|
description: Refusal message if content was refused
|
|
reasoning:
|
|
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: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
description: The token
|
|
logprob:
|
|
type: number
|
|
description: Log probability of the token
|
|
bytes:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: number
|
|
description: UTF-8 bytes of the token
|
|
top_logprobs:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
token:
|
|
type: string
|
|
logprob:
|
|
type: number
|
|
bytes:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: number
|
|
required:
|
|
- token
|
|
- logprob
|
|
- bytes
|
|
description: Top alternative tokens with probabilities
|
|
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: object
|
|
nullable: true
|
|
properties:
|
|
content:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/ChatTokenLogprob'
|
|
description: Log probabilities for content tokens
|
|
refusal:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/ChatTokenLogprob'
|
|
description: Log probabilities for refusal tokens
|
|
required:
|
|
- 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:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/ChatFinishReasonEnum'
|
|
- nullable: true
|
|
- nullable: true
|
|
index:
|
|
type: number
|
|
description: Choice index
|
|
example: 0
|
|
message:
|
|
$ref: '#/components/schemas/ChatAssistantMessage'
|
|
logprobs:
|
|
$ref: '#/components/schemas/ChatTokenLogprobs'
|
|
required:
|
|
- finish_reason
|
|
- index
|
|
- message
|
|
description: Chat completion choice
|
|
example:
|
|
finish_reason: stop
|
|
index: 0
|
|
message:
|
|
role: assistant
|
|
content: The capital of France is Paris.
|
|
logprobs: null
|
|
ChatUsage:
|
|
type: object
|
|
properties:
|
|
completion_tokens:
|
|
type: number
|
|
description: Number of tokens in the completion
|
|
prompt_tokens:
|
|
type: number
|
|
description: Number of tokens in the prompt
|
|
total_tokens:
|
|
type: number
|
|
description: Total number of tokens
|
|
completion_tokens_details:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
reasoning_tokens:
|
|
type: number
|
|
nullable: true
|
|
description: Tokens used for reasoning
|
|
audio_tokens:
|
|
type: number
|
|
nullable: true
|
|
description: Tokens used for audio output
|
|
accepted_prediction_tokens:
|
|
type: number
|
|
nullable: true
|
|
description: Accepted prediction tokens
|
|
rejected_prediction_tokens:
|
|
type: number
|
|
nullable: true
|
|
description: Rejected prediction tokens
|
|
description: Detailed completion token usage
|
|
prompt_tokens_details:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
cached_tokens:
|
|
type: number
|
|
description: Cached prompt tokens
|
|
cache_write_tokens:
|
|
type: number
|
|
description: Tokens written to cache. Only returned for models with explicit caching and cache write pricing.
|
|
audio_tokens:
|
|
type: number
|
|
description: Audio input tokens
|
|
video_tokens:
|
|
type: number
|
|
description: Video input tokens
|
|
description: Detailed prompt token usage
|
|
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: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: Unique completion identifier
|
|
example: chatcmpl-123
|
|
choices:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/ChatChoice'
|
|
description: List of completion choices
|
|
created:
|
|
type: number
|
|
description: Unix timestamp of creation
|
|
example: 1677652288
|
|
model:
|
|
type: string
|
|
description: Model used for completion
|
|
example: openai/gpt-4
|
|
object:
|
|
type: string
|
|
enum:
|
|
- chat.completion
|
|
system_fingerprint:
|
|
type: string
|
|
nullable: true
|
|
description: System fingerprint
|
|
example: fp_44709d6fcb
|
|
service_tier:
|
|
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
|
|
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
|
|
properties:
|
|
index:
|
|
type: number
|
|
description: Tool call index in the array
|
|
example: 0
|
|
id:
|
|
type: string
|
|
description: Tool call identifier
|
|
example: call_abc123
|
|
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
|
|
required:
|
|
- index
|
|
description: Tool call delta for streaming responses
|
|
example:
|
|
index: 0
|
|
id: call_abc123
|
|
type: function
|
|
function:
|
|
name: get_weather
|
|
arguments: '{"location":'
|
|
ChatStreamDelta:
|
|
type: object
|
|
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:
|
|
type: string
|
|
nullable: true
|
|
description: Reasoning content delta
|
|
example: I need to
|
|
refusal:
|
|
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/ChatReasoningDetails'
|
|
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:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/ChatFinishReasonEnum'
|
|
- nullable: true
|
|
- nullable: true
|
|
index:
|
|
type: number
|
|
description: Choice index
|
|
example: 0
|
|
logprobs:
|
|
$ref: '#/components/schemas/ChatTokenLogprobs'
|
|
required:
|
|
- delta
|
|
- finish_reason
|
|
- index
|
|
description: Streaming completion choice chunk
|
|
example:
|
|
index: 0
|
|
delta:
|
|
role: assistant
|
|
content: Hello
|
|
finish_reason: null
|
|
ChatStreamChunk:
|
|
type: object
|
|
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: number
|
|
description: Unix timestamp of creation
|
|
example: 1677652288
|
|
model:
|
|
type: string
|
|
description: Model used for completion
|
|
example: openai/gpt-4
|
|
object:
|
|
type: string
|
|
enum:
|
|
- chat.completion.chunk
|
|
system_fingerprint:
|
|
type: string
|
|
description: System fingerprint
|
|
example: fp_44709d6fcb
|
|
service_tier:
|
|
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: number
|
|
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: object
|
|
properties:
|
|
role:
|
|
type: string
|
|
enum:
|
|
- system
|
|
content:
|
|
anyOf:
|
|
- type: string
|
|
- type: array
|
|
items:
|
|
$ref: '#/components/schemas/ChatContentText'
|
|
description: System message content
|
|
example: You are a helpful assistant.
|
|
name:
|
|
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: object
|
|
properties:
|
|
role:
|
|
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:
|
|
type: string
|
|
description: Optional name for the user
|
|
example: User
|
|
required:
|
|
- role
|
|
- content
|
|
description: User message
|
|
example:
|
|
role: user
|
|
content: What is the capital of France?
|
|
ChatDeveloperMessage:
|
|
type: object
|
|
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
|
|
required:
|
|
- role
|
|
- content
|
|
description: Developer message
|
|
example:
|
|
role: developer
|
|
content: This is a message from the developer.
|
|
ChatToolMessage:
|
|
type: object
|
|
properties:
|
|
role:
|
|
type: string
|
|
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:
|
|
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
|
|
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
|
|
enum:
|
|
- auto
|
|
- concise
|
|
- detailed
|
|
ChatFormatTextConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- text
|
|
required:
|
|
- type
|
|
description: Default text response format
|
|
example:
|
|
type: text
|
|
ChatJsonSchemaConfig:
|
|
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:
|
|
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
|
|
example:
|
|
name: math_response
|
|
description: A mathematical response
|
|
schema:
|
|
type: object
|
|
properties:
|
|
answer:
|
|
type: number
|
|
required:
|
|
- answer
|
|
strict: true
|
|
ChatFormatJsonSchemaConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- json_schema
|
|
json_schema:
|
|
$ref: '#/components/schemas/ChatJsonSchemaConfig'
|
|
required:
|
|
- type
|
|
- json_schema
|
|
description: JSON Schema response format for structured outputs
|
|
example:
|
|
type: json_schema
|
|
json_schema:
|
|
name: math_response
|
|
schema:
|
|
type: object
|
|
properties:
|
|
answer:
|
|
type: number
|
|
required:
|
|
- answer
|
|
ChatFormatGrammarConfig:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- grammar
|
|
grammar:
|
|
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
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- python
|
|
required:
|
|
- type
|
|
description: Python code response format
|
|
example:
|
|
type: python
|
|
ChatStreamOptions:
|
|
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
|
|
example:
|
|
include_usage: true
|
|
ChatNamedToolChoice:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- function
|
|
function:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
description: Function name to call
|
|
example: get_weather
|
|
required:
|
|
- name
|
|
required:
|
|
- type
|
|
- function
|
|
description: Named tool choice for specific function
|
|
example:
|
|
type: function
|
|
function:
|
|
name: get_weather
|
|
ChatToolChoice:
|
|
anyOf:
|
|
- type: string
|
|
enum:
|
|
- none
|
|
- type: string
|
|
enum:
|
|
- auto
|
|
- type: string
|
|
enum:
|
|
- required
|
|
- $ref: '#/components/schemas/ChatNamedToolChoice'
|
|
description: Tool choice configuration
|
|
example: auto
|
|
ChatWebSearchServerTool:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- openrouter:web_search
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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: number
|
|
minimum: 1
|
|
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:
|
|
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.
|
|
user_location:
|
|
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.
|
|
allowed_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Limit search results to these domains. Applies to Exa and Parallel engines. Not supported with Firecrawl
|
|
or native provider search.
|
|
excluded_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Exclude search results from these domains. Applies to Exa and Parallel engines. Not supported with
|
|
Firecrawl or native provider search.
|
|
required:
|
|
- type
|
|
description: 'OpenRouter built-in server tool: searches the web for current information'
|
|
example:
|
|
type: openrouter:web_search
|
|
parameters:
|
|
engine: auto
|
|
max_results: 5
|
|
ChatWebSearchShorthand:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- web_search
|
|
- web_search_preview
|
|
- web_search_preview_2025_03_11
|
|
- web_search_2025_08_26
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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: number
|
|
minimum: 1
|
|
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:
|
|
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.
|
|
user_location:
|
|
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.
|
|
allowed_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Limit search results to these domains. Applies to Exa and Parallel engines. Not supported with Firecrawl or
|
|
native provider search.
|
|
excluded_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Exclude search results from these domains. Applies to Exa and Parallel engines. Not supported with Firecrawl
|
|
or native provider search.
|
|
parameters:
|
|
type: object
|
|
properties:
|
|
engine:
|
|
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
|
|
max_results:
|
|
type: number
|
|
minimum: 1
|
|
maximum: 25
|
|
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: number
|
|
minimum: 1
|
|
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:
|
|
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.
|
|
user_location:
|
|
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.
|
|
allowed_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Limit search results to these domains. Applies to Exa and Parallel engines. Not supported with Firecrawl
|
|
or native provider search.
|
|
excluded_domains:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: >-
|
|
Exclude search results from these domains. Applies to Exa and Parallel engines. Not supported with
|
|
Firecrawl or native provider search.
|
|
required:
|
|
- type
|
|
description: Web search tool using OpenAI Responses API syntax. Automatically converted to openrouter:web_search.
|
|
ChatFunctionTool:
|
|
anyOf:
|
|
- type: object
|
|
properties:
|
|
type:
|
|
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/ChatWebSearchServerTool'
|
|
- $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:
|
|
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)
|
|
example:
|
|
echo_upstream_body: true
|
|
ChatRequest:
|
|
type: object
|
|
properties:
|
|
provider:
|
|
type: object
|
|
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:
|
|
$ref: '#/components/schemas/DataCollection'
|
|
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
|
|
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.
|
|
only:
|
|
type: array
|
|
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.
|
|
ignore:
|
|
type: array
|
|
nullable: true
|
|
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.
|
|
quantizations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/Quantization'
|
|
description: A list of quantization levels to filter the provider by.
|
|
sort:
|
|
allOf:
|
|
- $ref: '#/components/schemas/ProviderSort'
|
|
- 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.
|
|
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
|
|
description: When multiple model providers are available, optionally indicate your routing preference.
|
|
plugins:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
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/*
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- moderation
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- web
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the web-search plugin for this request. Defaults to true.
|
|
max_results:
|
|
type: number
|
|
search_prompt:
|
|
type: string
|
|
engine:
|
|
$ref: '#/components/schemas/WebSearchEngine'
|
|
include_domains:
|
|
type: array
|
|
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
|
|
items:
|
|
type: string
|
|
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
|
|
- type: object
|
|
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'
|
|
required:
|
|
- id
|
|
- type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
enum:
|
|
- response-healing
|
|
enabled:
|
|
type: boolean
|
|
description: Set to false to disable the response-healing plugin for this request. Defaults to true.
|
|
required:
|
|
- id
|
|
- type: object
|
|
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.
|
|
engine:
|
|
$ref: '#/components/schemas/ContextCompressionEngine'
|
|
required:
|
|
- id
|
|
description: Plugins you want to enable for this request, including their settings.
|
|
route:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- fallback
|
|
- sort
|
|
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").
|
|
x-speakeasy-deprecation-message: Use providers.sort.partition instead.
|
|
x-speakeasy-ignore: true
|
|
x-fern-ignore: true
|
|
user:
|
|
type: string
|
|
description: Unique user identifier
|
|
example: user-123
|
|
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:
|
|
type: object
|
|
properties:
|
|
trace_id:
|
|
type: string
|
|
trace_name:
|
|
type: string
|
|
span_name:
|
|
type: string
|
|
generation_name:
|
|
type: string
|
|
parent_span_id:
|
|
type: string
|
|
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.
|
|
messages:
|
|
type: array
|
|
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
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
description: Frequency penalty (-2.0 to 2.0)
|
|
example: 0
|
|
logit_bias:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
type: number
|
|
description: Token logit bias adjustments
|
|
example:
|
|
'50256': -100
|
|
logprobs:
|
|
type: boolean
|
|
nullable: true
|
|
description: Return log probabilities
|
|
example: false
|
|
top_logprobs:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 20
|
|
description: Number of top log probabilities to return (0-20)
|
|
example: 5
|
|
max_completion_tokens:
|
|
type: number
|
|
nullable: true
|
|
minimum: 1
|
|
description: Maximum tokens in completion
|
|
example: 100
|
|
max_tokens:
|
|
type: number
|
|
nullable: true
|
|
minimum: 1
|
|
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
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
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
|
|
description: Constrains effort on reasoning for reasoning models
|
|
example: medium
|
|
summary:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/ChatReasoningSummaryVerbosityEnum'
|
|
- nullable: true
|
|
- nullable: true
|
|
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
|
|
description: Response format configuration
|
|
example:
|
|
type: json_object
|
|
seed:
|
|
type: integer
|
|
nullable: true
|
|
description: Random seed for deterministic outputs
|
|
example: 42
|
|
stop:
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 2
|
|
default: 1
|
|
description: Sampling temperature (0-2)
|
|
example: 0.7
|
|
parallel_tool_calls:
|
|
type: boolean
|
|
nullable: true
|
|
tool_choice:
|
|
$ref: '#/components/schemas/ChatToolChoice'
|
|
tools:
|
|
type: array
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 1
|
|
default: 1
|
|
description: Nucleus sampling parameter (0-1)
|
|
example: 1
|
|
debug:
|
|
$ref: '#/components/schemas/ChatDebugOptions'
|
|
image_config:
|
|
type: object
|
|
additionalProperties:
|
|
anyOf:
|
|
- type: string
|
|
- type: number
|
|
- 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:
|
|
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:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- ephemeral
|
|
ttl:
|
|
type: string
|
|
enum:
|
|
- 5m
|
|
- 1h
|
|
required:
|
|
- type
|
|
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
|
|
enum:
|
|
- auto
|
|
- default
|
|
- flex
|
|
- priority
|
|
- scale
|
|
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
|
|
CreateChargeRequest:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: number
|
|
sender:
|
|
type: string
|
|
chain_id:
|
|
type: integer
|
|
enum:
|
|
- 1
|
|
- 137
|
|
- 8453
|
|
required:
|
|
- amount
|
|
- sender
|
|
- chain_id
|
|
description: Create a Coinbase charge for crypto payment
|
|
example:
|
|
amount: 100
|
|
sender: '0x1234567890123456789012345678901234567890'
|
|
chain_id: 1
|
|
ProviderPreferences:
|
|
type: object
|
|
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:
|
|
$ref: '#/components/schemas/DataCollection'
|
|
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
|
|
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.
|
|
only:
|
|
type: array
|
|
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.
|
|
ignore:
|
|
type: array
|
|
nullable: true
|
|
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.
|
|
quantizations:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
$ref: '#/components/schemas/Quantization'
|
|
description: A list of quantization levels to filter the provider by.
|
|
sort:
|
|
allOf:
|
|
- $ref: '#/components/schemas/ProviderSort'
|
|
- 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.
|
|
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'
|
|
description: Provider routing preferences for the request.
|
|
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
|
|
example:
|
|
prompt: '0.00003'
|
|
completion: '0.00006'
|
|
request: '0'
|
|
image: '0'
|
|
ModelGroup:
|
|
type: string
|
|
enum:
|
|
- Router
|
|
- Media
|
|
- Other
|
|
- GPT
|
|
- Claude
|
|
- Gemini
|
|
- Grok
|
|
- Cohere
|
|
- Nova
|
|
- Qwen
|
|
- Yi
|
|
- DeepSeek
|
|
- Mistral
|
|
- Llama2
|
|
- Llama3
|
|
- Llama4
|
|
- PaLM
|
|
- RWKV
|
|
- Qwen3
|
|
example: GPT
|
|
description: Tokenizer type used by the model
|
|
InputModality:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
- file
|
|
- audio
|
|
- video
|
|
example: text
|
|
OutputModality:
|
|
type: string
|
|
enum:
|
|
- text
|
|
- image
|
|
- embeddings
|
|
- audio
|
|
- video
|
|
example: text
|
|
ModelArchitecture:
|
|
type: object
|
|
properties:
|
|
tokenizer:
|
|
$ref: '#/components/schemas/ModelGroup'
|
|
instruct_type:
|
|
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
|
|
example: chatml
|
|
description: Instruction format type
|
|
modality:
|
|
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: number
|
|
nullable: true
|
|
description: Context length from the top provider
|
|
example: 8192
|
|
max_completion_tokens:
|
|
type: number
|
|
nullable: true
|
|
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:
|
|
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
|
|
- top_k
|
|
- min_p
|
|
- top_a
|
|
- frequency_penalty
|
|
- presence_penalty
|
|
- repetition_penalty
|
|
- max_tokens
|
|
- logit_bias
|
|
- logprobs
|
|
- top_logprobs
|
|
- seed
|
|
- response_format
|
|
- structured_outputs
|
|
- stop
|
|
- tools
|
|
- tool_choice
|
|
- parallel_tool_calls
|
|
- include_reasoning
|
|
- reasoning
|
|
- reasoning_effort
|
|
- web_search_options
|
|
- verbosity
|
|
example: temperature
|
|
DefaultParameters:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
temperature:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 2
|
|
top_p:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 1
|
|
top_k:
|
|
type: integer
|
|
nullable: true
|
|
minimum: 0
|
|
frequency_penalty:
|
|
type: number
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
presence_penalty:
|
|
type: number
|
|
nullable: true
|
|
minimum: -2
|
|
maximum: 2
|
|
repetition_penalty:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
maximum: 2
|
|
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
|
|
Model:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
description: Unique identifier for the model
|
|
example: openai/gpt-4
|
|
canonical_slug:
|
|
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: number
|
|
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:
|
|
type: number
|
|
nullable: true
|
|
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:
|
|
type: string
|
|
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'
|
|
required:
|
|
- id
|
|
- canonical_slug
|
|
- name
|
|
- created
|
|
- pricing
|
|
- context_length
|
|
- architecture
|
|
- top_provider
|
|
- per_request_limits
|
|
- supported_parameters
|
|
- default_parameters
|
|
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
|
|
ModelsListResponseData:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Model'
|
|
description: List of available models
|
|
ModelsListResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/ModelsListResponseData'
|
|
required:
|
|
- data
|
|
description: List of available models
|
|
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
|
|
ModelsCountResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: object
|
|
properties:
|
|
count:
|
|
type: number
|
|
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
|
|
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
|
|
description: Instruction format type
|
|
EndpointStatus:
|
|
type: integer
|
|
enum:
|
|
- 0
|
|
- -1
|
|
- -2
|
|
- -3
|
|
- -5
|
|
- -10
|
|
example: 0
|
|
PercentileStats:
|
|
type: object
|
|
nullable: true
|
|
properties:
|
|
p50:
|
|
type: number
|
|
description: Median (50th percentile)
|
|
example: 25.5
|
|
p75:
|
|
type: number
|
|
description: 75th percentile
|
|
example: 35.2
|
|
p90:
|
|
type: number
|
|
description: 90th percentile
|
|
example: 48.7
|
|
p99:
|
|
type: number
|
|
description: 99th percentile
|
|
example: 85.3
|
|
required:
|
|
- p50
|
|
- p75
|
|
- p90
|
|
- p99
|
|
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
|
|
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: number
|
|
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: number
|
|
nullable: true
|
|
max_prompt_tokens:
|
|
type: number
|
|
nullable: true
|
|
supported_parameters:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Parameter'
|
|
status:
|
|
$ref: '#/components/schemas/EndpointStatus'
|
|
uptime_last_30m:
|
|
type: number
|
|
nullable: true
|
|
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.
|
|
required:
|
|
- name
|
|
- model_id
|
|
- model_name
|
|
- context_length
|
|
- pricing
|
|
- provider_name
|
|
- tag
|
|
- quantization
|
|
- max_completion_tokens
|
|
- max_prompt_tokens
|
|
- supported_parameters
|
|
- uptime_last_30m
|
|
- supports_implicit_caching
|
|
- latency_last_30m
|
|
- throughput_last_30m
|
|
description: Information about a specific model endpoint
|
|
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
|
|
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
|
|
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:
|
|
type: number
|
|
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.
|
|
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
|
|
required:
|
|
- id
|
|
- name
|
|
- created
|
|
- description
|
|
- architecture
|
|
- endpoints
|
|
description: List of available endpoints for a model
|
|
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
|
|
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
|
|
ConflictResponseErrorData:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
nullable: true
|
|
required:
|
|
- code
|
|
- message
|
|
description: Error data for ConflictResponse
|
|
example:
|
|
code: 409
|
|
message: Resource conflict. Please try again later.
|
|
ConflictResponse:
|
|
type: object
|
|
properties:
|
|
error:
|
|
$ref: '#/components/schemas/ConflictResponseErrorData'
|
|
user_id:
|
|
type: string
|
|
nullable: true
|
|
required:
|
|
- error
|
|
description: Conflict - Resource conflict or concurrent modification
|
|
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'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/OpenResponsesResult'
|
|
text/event-stream:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/StreamEvents'
|
|
required:
|
|
- data
|
|
x-speakeasy-sse-sentinel: '[DONE]'
|
|
'400':
|
|
description: Bad Request - Invalid request parameters or malformed input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'402':
|
|
description: Payment Required - Insufficient credits or quota to complete request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PaymentRequiredResponse'
|
|
'404':
|
|
description: Not Found - Resource does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'408':
|
|
description: Request Timeout - Operation exceeded time limit
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RequestTimeoutResponse'
|
|
'413':
|
|
description: Payload Too Large - Request payload exceeds size limits
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PayloadTooLargeResponse'
|
|
'422':
|
|
description: Unprocessable Entity - Semantic validation failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnprocessableEntityResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
'502':
|
|
description: Bad Gateway - Provider/upstream API failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadGatewayResponse'
|
|
'503':
|
|
description: Service Unavailable - Service temporarily unavailable
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ServiceUnavailableResponse'
|
|
'524':
|
|
description: Infrastructure Timeout - Request timed out at our edge network
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
|
|
'529':
|
|
description: Provider Overloaded - Provider is temporarily overloaded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
|
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'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MessagesResult'
|
|
text/event-stream:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
event:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/MessagesStreamEvents'
|
|
required:
|
|
- event
|
|
- data
|
|
x-speakeasy-sse-sentinel: '[DONE]'
|
|
'400':
|
|
description: Invalid request error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'401':
|
|
description: Authentication error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'403':
|
|
description: Permission denied error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'404':
|
|
description: Not found error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'429':
|
|
description: Rate limit error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'500':
|
|
description: API error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'503':
|
|
description: Overloaded error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
'529':
|
|
description: Overloaded error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
enum:
|
|
- error
|
|
error:
|
|
type: object
|
|
properties:
|
|
type:
|
|
type: string
|
|
message:
|
|
type: string
|
|
required:
|
|
- type
|
|
- message
|
|
required:
|
|
- type
|
|
- error
|
|
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
|
|
responses:
|
|
'200':
|
|
description: Returns user activity data grouped by endpoint
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/ActivityItem'
|
|
description: List of activity items
|
|
required:
|
|
- data
|
|
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 date format or date range
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'403':
|
|
description: Forbidden - Only management keys can fetch activity
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ForbiddenResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Successful chat completion response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ChatResult'
|
|
text/event-stream:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/ChatStreamChunk'
|
|
required:
|
|
- data
|
|
x-speakeasy-sse-sentinel: '[DONE]'
|
|
'400':
|
|
description: Bad Request - Invalid request parameters or malformed input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'402':
|
|
description: Payment Required - Insufficient credits or quota to complete request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PaymentRequiredResponse'
|
|
'404':
|
|
description: Not Found - Resource does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'408':
|
|
description: Request Timeout - Operation exceeded time limit
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RequestTimeoutResponse'
|
|
'413':
|
|
description: Payload Too Large - Request payload exceeds size limits
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PayloadTooLargeResponse'
|
|
'422':
|
|
description: Unprocessable Entity - Semantic validation failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnprocessableEntityResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
'502':
|
|
description: Bad Gateway - Provider/upstream API failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadGatewayResponse'
|
|
'503':
|
|
description: Service Unavailable - Service temporarily unavailable
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ServiceUnavailableResponse'
|
|
'524':
|
|
description: Infrastructure Timeout - Request timed out at our edge network
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
|
|
'529':
|
|
description: Provider Overloaded - Provider is temporarily overloaded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
|
/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
|
|
description: Total credits purchased
|
|
example: 100.5
|
|
total_usage:
|
|
type: number
|
|
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
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'403':
|
|
description: Forbidden - Only management keys can fetch credits
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ForbiddenResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/credits/coinbase:
|
|
post:
|
|
security:
|
|
- bearer: []
|
|
x-speakeasy-name-override: createCoinbaseCharge
|
|
tags:
|
|
- Credits
|
|
summary: Create a Coinbase charge for crypto payment
|
|
operationId: createCoinbaseCharge
|
|
description: Create a Coinbase charge for crypto payment
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CreateChargeRequest'
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Returns the calldata to fulfill the transaction
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
created_at:
|
|
type: string
|
|
expires_at:
|
|
type: string
|
|
web3_data:
|
|
type: object
|
|
properties:
|
|
transfer_intent:
|
|
type: object
|
|
properties:
|
|
call_data:
|
|
type: object
|
|
properties:
|
|
deadline:
|
|
type: string
|
|
fee_amount:
|
|
type: string
|
|
id:
|
|
type: string
|
|
operator:
|
|
type: string
|
|
prefix:
|
|
type: string
|
|
recipient:
|
|
type: string
|
|
recipient_amount:
|
|
type: string
|
|
recipient_currency:
|
|
type: string
|
|
refund_destination:
|
|
type: string
|
|
signature:
|
|
type: string
|
|
required:
|
|
- deadline
|
|
- fee_amount
|
|
- id
|
|
- operator
|
|
- prefix
|
|
- recipient
|
|
- recipient_amount
|
|
- recipient_currency
|
|
- refund_destination
|
|
- signature
|
|
metadata:
|
|
type: object
|
|
properties:
|
|
chain_id:
|
|
type: number
|
|
contract_address:
|
|
type: string
|
|
sender:
|
|
type: string
|
|
required:
|
|
- chain_id
|
|
- contract_address
|
|
- sender
|
|
required:
|
|
- call_data
|
|
- metadata
|
|
required:
|
|
- transfer_intent
|
|
required:
|
|
- id
|
|
- created_at
|
|
- expires_at
|
|
- web3_data
|
|
required:
|
|
- data
|
|
'400':
|
|
description: Bad Request - Invalid credit amount or request body
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/embeddings:
|
|
post:
|
|
x-speakeasy-name-override: generate
|
|
tags:
|
|
- Embeddings
|
|
summary: Submit an embedding request
|
|
description: Submits an embedding request to the embeddings router
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
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
|
|
model:
|
|
type: string
|
|
encoding_format:
|
|
type: string
|
|
enum:
|
|
- float
|
|
- base64
|
|
dimensions:
|
|
type: integer
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
user:
|
|
type: string
|
|
provider:
|
|
$ref: '#/components/schemas/ProviderPreferences'
|
|
input_type:
|
|
type: string
|
|
required:
|
|
- input
|
|
- model
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Embedding response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
object:
|
|
type: string
|
|
enum:
|
|
- list
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
object:
|
|
type: string
|
|
enum:
|
|
- embedding
|
|
embedding:
|
|
anyOf:
|
|
- type: array
|
|
items:
|
|
type: number
|
|
- type: string
|
|
index:
|
|
type: number
|
|
required:
|
|
- object
|
|
- embedding
|
|
model:
|
|
type: string
|
|
usage:
|
|
type: object
|
|
properties:
|
|
prompt_tokens:
|
|
type: number
|
|
total_tokens:
|
|
type: number
|
|
cost:
|
|
type: number
|
|
required:
|
|
- prompt_tokens
|
|
- total_tokens
|
|
required:
|
|
- object
|
|
- data
|
|
- model
|
|
text/event-stream:
|
|
schema:
|
|
type: string
|
|
description: Not used for embeddings - embeddings do not support streaming
|
|
x-speakeasy-sse-sentinel: '[DONE]'
|
|
'400':
|
|
description: Bad Request - Invalid request parameters or malformed input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'402':
|
|
description: Payment Required - Insufficient credits or quota to complete request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PaymentRequiredResponse'
|
|
'404':
|
|
description: Not Found - Resource does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
'502':
|
|
description: Bad Gateway - Provider/upstream API failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadGatewayResponse'
|
|
'503':
|
|
description: Service Unavailable - Service temporarily unavailable
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ServiceUnavailableResponse'
|
|
'524':
|
|
description: Cloudflare Timeout - Provider request timed out at CDN edge
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
|
|
'529':
|
|
description: Provider Overloaded - Provider is temporarily overloaded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
|
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'
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
operationId: listEmbeddingsModels
|
|
/generation:
|
|
get:
|
|
tags:
|
|
- Generations
|
|
summary: Get request & usage metadata for a generation
|
|
parameters:
|
|
- schema:
|
|
type: string
|
|
minLength: 1
|
|
required: true
|
|
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
|
|
description: Total cost of the generation in USD
|
|
example: 0.0015
|
|
cache_discount:
|
|
type: number
|
|
nullable: true
|
|
description: Discount applied due to caching
|
|
example: 0.0002
|
|
upstream_inference_cost:
|
|
type: number
|
|
nullable: true
|
|
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: number
|
|
nullable: true
|
|
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
|
|
nullable: true
|
|
description: Total latency in milliseconds
|
|
example: 1250
|
|
moderation_latency:
|
|
type: number
|
|
nullable: true
|
|
description: Moderation latency in milliseconds
|
|
example: 50
|
|
generation_time:
|
|
type: number
|
|
nullable: true
|
|
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: number
|
|
nullable: true
|
|
description: Number of tokens in the prompt
|
|
example: 10
|
|
tokens_completion:
|
|
type: number
|
|
nullable: true
|
|
description: Number of tokens in the completion
|
|
example: 25
|
|
native_tokens_prompt:
|
|
type: number
|
|
nullable: true
|
|
description: Native prompt tokens as reported by provider
|
|
example: 10
|
|
native_tokens_completion:
|
|
type: number
|
|
nullable: true
|
|
description: Native completion tokens as reported by provider
|
|
example: 25
|
|
native_tokens_completion_images:
|
|
type: number
|
|
nullable: true
|
|
description: Native completion image tokens as reported by provider
|
|
example: 0
|
|
native_tokens_reasoning:
|
|
type: number
|
|
nullable: true
|
|
description: Native reasoning tokens as reported by provider
|
|
example: 5
|
|
native_tokens_cached:
|
|
type: number
|
|
nullable: true
|
|
description: Native cached tokens as reported by provider
|
|
example: 3
|
|
num_media_prompt:
|
|
type: number
|
|
nullable: true
|
|
description: Number of media items in the prompt
|
|
example: 1
|
|
num_input_audio_prompt:
|
|
type: number
|
|
nullable: true
|
|
description: Number of audio inputs in the prompt
|
|
example: 0
|
|
num_media_completion:
|
|
type: number
|
|
nullable: true
|
|
description: Number of media items in the completion
|
|
example: 0
|
|
num_search_results:
|
|
type: number
|
|
nullable: true
|
|
description: Number of search results included
|
|
example: 5
|
|
origin:
|
|
type: string
|
|
description: Origin URL of the request
|
|
example: https://openrouter.ai/
|
|
usage:
|
|
type: number
|
|
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
|
|
- video
|
|
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:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
endpoint_id:
|
|
type: string
|
|
model_permaslug:
|
|
type: string
|
|
provider_name:
|
|
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
|
|
status:
|
|
type: number
|
|
nullable: true
|
|
latency:
|
|
type: number
|
|
is_byok:
|
|
type: boolean
|
|
required:
|
|
- status
|
|
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
|
|
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
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'402':
|
|
description: Payment Required - Insufficient credits or quota to complete request
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PaymentRequiredResponse'
|
|
'404':
|
|
description: Not Found - Generation not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
'502':
|
|
description: Bad Gateway - Provider/upstream API failure
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadGatewayResponse'
|
|
'524':
|
|
description: Infrastructure Timeout - Request timed out at our edge network
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeNetworkTimeoutResponse'
|
|
'529':
|
|
description: Provider Overloaded - Provider is temporarily overloaded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ProviderOverloadedResponse'
|
|
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'
|
|
'400':
|
|
description: Bad Request - Invalid output_modalities value
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
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
|
|
required: false
|
|
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
|
|
required: false
|
|
name: use_rss
|
|
in: query
|
|
- schema:
|
|
type: string
|
|
required: false
|
|
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'
|
|
application/rss+xml:
|
|
schema:
|
|
type: string
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
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/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/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'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - No eligible endpoints found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
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
|
|
required: true
|
|
name: author
|
|
in: path
|
|
- schema:
|
|
type: string
|
|
required: true
|
|
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
|
|
'404':
|
|
description: Not Found - Model does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
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
|
|
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
|
|
example:
|
|
- US
|
|
- IE
|
|
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
|
|
required:
|
|
- data
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/keys:
|
|
get:
|
|
operationId: list
|
|
x-speakeasy-name-override: list
|
|
tags:
|
|
- API Keys
|
|
summary: List API keys
|
|
description: >-
|
|
List all API keys 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'
|
|
required: false
|
|
description: Whether to include disabled API keys in the response
|
|
name: include_disabled
|
|
in: query
|
|
- schema:
|
|
type: string
|
|
description: Number of API keys to skip for pagination
|
|
example: '0'
|
|
required: false
|
|
description: Number of API keys to skip for pagination
|
|
name: offset
|
|
in: query
|
|
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
|
|
nullable: true
|
|
description: Spending limit for the API key in USD
|
|
example: 100
|
|
limit_remaining:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
description: Total OpenRouter credit usage (in USD) for the API key
|
|
example: 25.5
|
|
usage_daily:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC day
|
|
example: 25.5
|
|
usage_weekly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 25.5
|
|
usage_monthly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC month
|
|
example: 25.5
|
|
byok_usage:
|
|
type: number
|
|
description: Total external BYOK usage (in USD) for the API key
|
|
example: 17.38
|
|
byok_usage_daily:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC day
|
|
example: 17.38
|
|
byok_usage_weekly:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 17.38
|
|
byok_usage_monthly:
|
|
type: number
|
|
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
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
post:
|
|
x-speakeasy-name-override: create
|
|
tags:
|
|
- API Keys
|
|
summary: Create a new API key
|
|
description: >-
|
|
Create a new API key for the authenticated user. [Management
|
|
key](/docs/guides/overview/auth/management-api-keys) required.
|
|
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
|
|
nullable: true
|
|
description: Optional spending limit for the API key in USD
|
|
example: 50
|
|
limit_reset:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
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'
|
|
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'
|
|
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
|
|
nullable: true
|
|
description: Spending limit for the API key in USD
|
|
example: 100
|
|
limit_remaining:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
description: Total OpenRouter credit usage (in USD) for the API key
|
|
example: 25.5
|
|
usage_daily:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC day
|
|
example: 25.5
|
|
usage_weekly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 25.5
|
|
usage_monthly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC month
|
|
example: 25.5
|
|
byok_usage:
|
|
type: number
|
|
description: Total external BYOK usage (in USD) for the API key
|
|
example: 17.38
|
|
byok_usage_daily:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC day
|
|
example: 17.38
|
|
byok_usage_weekly:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 17.38
|
|
byok_usage_monthly:
|
|
type: number
|
|
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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
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
operationId: createKeys
|
|
/keys/{hash}:
|
|
patch:
|
|
x-speakeasy-name-override: update
|
|
tags:
|
|
- API Keys
|
|
summary: Update an API key
|
|
description: Update an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
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
|
|
in: path
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
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
|
|
nullable: true
|
|
description: New spending limit for the API key in USD
|
|
example: 75
|
|
limit_reset:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
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
|
|
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
|
|
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
|
|
nullable: true
|
|
description: Spending limit for the API key in USD
|
|
example: 100
|
|
limit_remaining:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
description: Total OpenRouter credit usage (in USD) for the API key
|
|
example: 25.5
|
|
usage_daily:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC day
|
|
example: 25.5
|
|
usage_weekly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 25.5
|
|
usage_monthly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC month
|
|
example: 25.5
|
|
byok_usage:
|
|
type: number
|
|
description: Total external BYOK usage (in USD) for the API key
|
|
example: 17.38
|
|
byok_usage_daily:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC day
|
|
example: 17.38
|
|
byok_usage_weekly:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 17.38
|
|
byok_usage_monthly:
|
|
type: number
|
|
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
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - API key does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
operationId: updateKeys
|
|
delete:
|
|
x-speakeasy-name-override: delete
|
|
tags:
|
|
- API Keys
|
|
summary: Delete an API key
|
|
description: Delete an existing API key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
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
|
|
in: path
|
|
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
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - API key does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
operationId: deleteKeys
|
|
get:
|
|
operationId: getKey
|
|
x-speakeasy-name-override: get
|
|
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.
|
|
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
|
|
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
|
|
nullable: true
|
|
description: Spending limit for the API key in USD
|
|
example: 100
|
|
limit_remaining:
|
|
type: number
|
|
nullable: true
|
|
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
|
|
description: Total OpenRouter credit usage (in USD) for the API key
|
|
example: 25.5
|
|
usage_daily:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC day
|
|
example: 25.5
|
|
usage_weekly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 25.5
|
|
usage_monthly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC month
|
|
example: 25.5
|
|
byok_usage:
|
|
type: number
|
|
description: Total external BYOK usage (in USD) for the API key
|
|
example: 17.38
|
|
byok_usage_daily:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC day
|
|
example: 17.38
|
|
byok_usage_weekly:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 17.38
|
|
byok_usage_monthly:
|
|
type: number
|
|
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
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - API key does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'429':
|
|
description: Too Many Requests - Rate limit exceeded
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TooManyRequestsResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/guardrails:
|
|
get:
|
|
operationId: listGuardrails
|
|
x-speakeasy-name-override: list
|
|
tags:
|
|
- Guardrails
|
|
summary: List guardrails
|
|
description: >-
|
|
List all guardrails for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys)
|
|
required.
|
|
parameters:
|
|
- schema:
|
|
type: string
|
|
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: string
|
|
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 guardrails
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: Spending limit in USD
|
|
example: 100
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of allowed provider IDs
|
|
example:
|
|
- openai
|
|
- anthropic
|
|
- google
|
|
ignored_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of provider IDs to exclude from routing
|
|
example:
|
|
- azure
|
|
allowed_models:
|
|
type: array
|
|
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
|
|
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: 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'
|
|
description: List of guardrails
|
|
total_count:
|
|
type: number
|
|
description: Total number of guardrails
|
|
example: 25
|
|
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
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
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:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 200
|
|
description: Name for the new guardrail
|
|
example: My New Guardrail
|
|
description:
|
|
type: string
|
|
nullable: true
|
|
maxLength: 1000
|
|
description: Description of the guardrail
|
|
example: A guardrail for limiting API usage
|
|
limit_usd:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: Spending limit in USD
|
|
example: 50
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
minItems: 1
|
|
description: List of allowed provider IDs
|
|
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
|
|
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
|
|
required: true
|
|
responses:
|
|
'201':
|
|
description: Guardrail created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: Spending limit in USD
|
|
example: 100
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of allowed provider IDs
|
|
example:
|
|
- openai
|
|
- anthropic
|
|
- google
|
|
ignored_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of provider IDs to exclude from routing
|
|
example:
|
|
- azure
|
|
allowed_models:
|
|
type: array
|
|
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
|
|
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: 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'
|
|
description: The created guardrail
|
|
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
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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:
|
|
type: object
|
|
properties:
|
|
data:
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: Spending limit in USD
|
|
example: 100
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of allowed provider IDs
|
|
example:
|
|
- openai
|
|
- anthropic
|
|
- google
|
|
ignored_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of provider IDs to exclude from routing
|
|
example:
|
|
- azure
|
|
allowed_models:
|
|
type: array
|
|
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
|
|
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: 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'
|
|
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:
|
|
- 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 - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - Guardrail does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
patch:
|
|
operationId: updateGuardrail
|
|
x-speakeasy-name-override: update
|
|
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
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 200
|
|
description: New name for the guardrail
|
|
example: Updated Guardrail Name
|
|
description:
|
|
type: string
|
|
nullable: true
|
|
maxLength: 1000
|
|
description: New description for the guardrail
|
|
example: Updated description
|
|
limit_usd:
|
|
type: number
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: New spending limit in USD
|
|
example: 75
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
minItems: 1
|
|
description: New list of allowed provider IDs
|
|
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
|
|
enforce_zdr:
|
|
type: boolean
|
|
nullable: true
|
|
description: Whether to enforce zero data retention
|
|
example: true
|
|
example:
|
|
name: Updated Guardrail Name
|
|
description: Updated description
|
|
limit_usd: 75
|
|
reset_interval: weekly
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Guardrail updated successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
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
|
|
nullable: true
|
|
minimum: 0
|
|
exclusiveMinimum: true
|
|
description: Spending limit in USD
|
|
example: 100
|
|
reset_interval:
|
|
type: string
|
|
nullable: true
|
|
enum:
|
|
- daily
|
|
- weekly
|
|
- monthly
|
|
description: Interval at which the limit resets (daily, weekly, monthly)
|
|
example: monthly
|
|
allowed_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of allowed provider IDs
|
|
example:
|
|
- openai
|
|
- anthropic
|
|
- google
|
|
ignored_providers:
|
|
type: array
|
|
nullable: true
|
|
items:
|
|
type: string
|
|
description: List of provider IDs to exclude from routing
|
|
example:
|
|
- azure
|
|
allowed_models:
|
|
type: array
|
|
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
|
|
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: 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'
|
|
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'
|
|
'400':
|
|
description: Bad Request - Invalid request parameters
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - Guardrail does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
delete:
|
|
operationId: deleteGuardrail
|
|
x-speakeasy-name-override: delete
|
|
tags:
|
|
- Guardrails
|
|
summary: Delete a guardrail
|
|
description: Delete 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 delete
|
|
example: 550e8400-e29b-41d4-a716-446655440000
|
|
required: true
|
|
description: The unique identifier of the guardrail to delete
|
|
name: id
|
|
in: path
|
|
responses:
|
|
'200':
|
|
description: Guardrail deleted successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
deleted:
|
|
type: boolean
|
|
const: true
|
|
description: Confirmation that the guardrail was deleted
|
|
example: true
|
|
required:
|
|
- deleted
|
|
example:
|
|
deleted: true
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Not Found - Guardrail does not exist
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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.
|
|
parameters:
|
|
- schema:
|
|
type: string
|
|
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: string
|
|
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:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
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:
|
|
type: string
|
|
description: Label of the API key
|
|
example: prod-key
|
|
assigned_by:
|
|
type: string
|
|
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
|
|
- key_hash
|
|
- guardrail_id
|
|
- key_name
|
|
- key_label
|
|
- assigned_by
|
|
- created_at
|
|
description: List of key assignments
|
|
total_count:
|
|
type: number
|
|
description: Total number of key assignments for this guardrail
|
|
example: 25
|
|
required:
|
|
- data
|
|
- total_count
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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.
|
|
parameters:
|
|
- schema:
|
|
type: string
|
|
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: string
|
|
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:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
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:
|
|
type: string
|
|
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
|
|
description: List of member assignments
|
|
total_count:
|
|
type: number
|
|
description: Total number of member assignments
|
|
example: 10
|
|
required:
|
|
- data
|
|
- total_count
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/guardrails/{id}/assignments/keys:
|
|
get:
|
|
operationId: listGuardrailKeyAssignments
|
|
x-speakeasy-name-override: listGuardrailKeyAssignments
|
|
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.
|
|
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: string
|
|
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: string
|
|
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:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
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:
|
|
type: string
|
|
description: Label of the API key
|
|
example: prod-key
|
|
assigned_by:
|
|
type: string
|
|
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
|
|
- key_hash
|
|
- guardrail_id
|
|
- key_name
|
|
- key_label
|
|
- assigned_by
|
|
- created_at
|
|
description: List of key assignments
|
|
total_count:
|
|
type: number
|
|
description: Total number of key assignments for this guardrail
|
|
example: 25
|
|
required:
|
|
- data
|
|
- total_count
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
post:
|
|
operationId: bulkAssignKeysToGuardrail
|
|
x-speakeasy-name-override: bulkAssignKeys
|
|
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.
|
|
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:
|
|
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
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Assignment result
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
assigned_count:
|
|
type: number
|
|
description: Number of keys successfully assigned
|
|
example: 3
|
|
required:
|
|
- assigned_count
|
|
'400':
|
|
description: Bad Request - Invalid input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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.
|
|
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: string
|
|
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: string
|
|
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:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
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:
|
|
type: string
|
|
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
|
|
description: List of member assignments
|
|
total_count:
|
|
type: number
|
|
description: Total number of member assignments
|
|
example: 10
|
|
required:
|
|
- data
|
|
- total_count
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
post:
|
|
operationId: bulkAssignMembersToGuardrail
|
|
x-speakeasy-name-override: bulkAssignMembers
|
|
tags:
|
|
- Guardrails
|
|
summary: Bulk assign members to a guardrail
|
|
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
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
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
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Assignment result
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
assigned_count:
|
|
type: number
|
|
description: Number of members successfully assigned
|
|
example: 2
|
|
required:
|
|
- assigned_count
|
|
'400':
|
|
description: Bad Request - Invalid input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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:
|
|
type: object
|
|
properties:
|
|
key_hashes:
|
|
type: array
|
|
items:
|
|
type: string
|
|
minLength: 1
|
|
minItems: 1
|
|
description: Array of API key hashes to unassign from the guardrail
|
|
example:
|
|
- c56454edb818d6b14bc0d61c46025f1450b0f4012d12304ab40aacb519fcbc93
|
|
required:
|
|
- key_hashes
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Unassignment result
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
unassigned_count:
|
|
type: number
|
|
description: Number of keys successfully unassigned
|
|
example: 3
|
|
required:
|
|
- unassigned_count
|
|
'400':
|
|
description: Bad Request - Invalid input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/guardrails/{id}/assignments/members/remove:
|
|
post:
|
|
operationId: bulkUnassignMembersFromGuardrail
|
|
x-speakeasy-name-override: bulkUnassignMembers
|
|
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.
|
|
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:
|
|
type: object
|
|
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
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Unassignment result
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
unassigned_count:
|
|
type: number
|
|
description: Number of members successfully unassigned
|
|
example: 2
|
|
required:
|
|
- unassigned_count
|
|
'400':
|
|
description: Bad Request - Invalid input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Missing or invalid authentication
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'404':
|
|
description: Guardrail not found
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/NotFoundResponse'
|
|
'500':
|
|
description: Internal Server Error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/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
|
|
nullable: true
|
|
description: Spending limit for the API key in USD
|
|
example: 100
|
|
usage:
|
|
type: number
|
|
description: Total OpenRouter credit usage (in USD) for the API key
|
|
example: 25.5
|
|
usage_daily:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC day
|
|
example: 25.5
|
|
usage_weekly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 25.5
|
|
usage_monthly:
|
|
type: number
|
|
description: OpenRouter credit usage (in USD) for the current UTC month
|
|
example: 25.5
|
|
byok_usage:
|
|
type: number
|
|
description: Total external BYOK usage (in USD) for the API key
|
|
example: 17.38
|
|
byok_usage_daily:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC day
|
|
example: 17.38
|
|
byok_usage_weekly:
|
|
type: number
|
|
description: External BYOK usage (in USD) for the current UTC week (Monday-Sunday)
|
|
example: 17.38
|
|
byok_usage_monthly:
|
|
type: number
|
|
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
|
|
nullable: true
|
|
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: number
|
|
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.
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/auth/keys:
|
|
post:
|
|
operationId: exchangeAuthCodeForAPIKey
|
|
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
|
|
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
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: Successfully exchanged code for an API key
|
|
content:
|
|
application/json:
|
|
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
|
|
required:
|
|
- key
|
|
- user_id
|
|
example:
|
|
key: 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
|
|
user_id: user_2yOPcMpKoQhcd4bVgSMlELRaIah
|
|
'400':
|
|
description: Bad Request - Invalid request parameters or malformed input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'403':
|
|
description: Forbidden - Authentication successful but insufficient permissions
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ForbiddenResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
/auth/keys/code:
|
|
post:
|
|
x-speakeasy-name-override: createAuthCode
|
|
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
|
|
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
|
|
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
|
|
x-speakeasy-ignore: true
|
|
x-fern-ignore: true
|
|
spawn_cloud:
|
|
type: string
|
|
description: Cloud identifier for spawn telemetry
|
|
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
|
|
required: true
|
|
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: number
|
|
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
|
|
'400':
|
|
description: Bad Request - Invalid request parameters or malformed input
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/BadRequestResponse'
|
|
'401':
|
|
description: Unauthorized - Authentication required or invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/UnauthorizedResponse'
|
|
'409':
|
|
description: Conflict - App upsert conflict during auth code creation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ConflictResponse'
|
|
'500':
|
|
description: Internal Server Error - Unexpected server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InternalServerResponse'
|
|
operationId: createAuthKeysCode
|
|
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: Providers
|
|
description: Provider information endpoints
|
|
- name: beta.responses
|
|
description: beta.responses endpoints
|
|
x-fern-base-path: /
|
|
x-retry-strategy:
|
|
type: exponential
|
|
initialDelay: 500
|
|
maxDelay: 60000
|
|
maxAttempts: 3
|