From aa968e28974417db500904694c8998a238dd100a Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Sat, 18 Oct 2025 01:44:03 -0400 Subject: [PATCH] chore: update OpenAPI specification from openrouter-web (#5) Co-authored-by: yogasanas <124478414+yogasanas@users.noreply.github.com> --- .speakeasy/in.openapi.yaml | 7790 ++++++++++++++++++++++++++++++------ 1 file changed, 6549 insertions(+), 1241 deletions(-) diff --git a/.speakeasy/in.openapi.yaml b/.speakeasy/in.openapi.yaml index 748098b..34b8048 100644 --- a/.speakeasy/in.openapi.yaml +++ b/.speakeasy/in.openapi.yaml @@ -1,8 +1,8 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: - title: OpenRouter Chat Completions API + title: OpenRouter API version: 1.0.0 - description: OpenAI-compatible Chat Completions API with additional OpenRouter features + description: OpenAI-compatible Chat Completions and Completions API with additional OpenRouter features contact: name: OpenRouter Support url: https://openrouter.ai/docs @@ -10,1072 +10,1122 @@ info: license: name: MIT url: https://opensource.org/licenses/MIT -servers: - - url: https://{provider_url}/api/v1 - x-speakeasy-server-id: production - variables: - provider_url: - default: openrouter.ai - description: Production server -security: - - ApiKey: [] -tags: - - name: Chat - description: Chat completion operations -externalDocs: - description: OpenRouter Documentation - url: https://openrouter.ai/docs components: - securitySchemes: - ApiKey: - type: http - scheme: bearer - description: API key as bearer token in Authorization header schemas: - ChatCompletionChunkWrapper: - type: object - required: [data] - properties: - data: - $ref: '#/components/schemas/ChatCompletionChunk' - ChatCompletionMessageToolCall: - 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 - ReasoningDetailSummary: + FileCitationAnnotation: type: object properties: type: type: string enum: - - reasoning.summary - summary: + - file_citation + file_id: type: string - id: + filename: type: string - nullable: true - format: - x-speakeasy-unknown-values: allow - type: string - nullable: true - enum: - - unknown - - openai-responses-v1 - - anthropic-claude-v1 - default: anthropic-claude-v1 index: type: number required: - type - - summary - description: Reasoning summary detail - ReasoningDetailEncrypted: - type: object - properties: - type: - type: string - enum: - - reasoning.encrypted - data: - type: string - id: - type: string - nullable: true - format: - x-speakeasy-unknown-values: allow - type: string - nullable: true - enum: - - unknown - - openai-responses-v1 - - anthropic-claude-v1 - default: anthropic-claude-v1 - index: - type: number - required: - - type - - data - description: Encrypted reasoning detail - 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: - x-speakeasy-unknown-values: allow - type: string - nullable: true - enum: - - unknown - - openai-responses-v1 - - anthropic-claude-v1 - default: anthropic-claude-v1 - index: - type: number - required: - - type - description: Text reasoning detail - ReasoningDetail: - 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 information - FileAnnotationDetail: - type: object - properties: - type: - type: string - enum: - - file - file: - type: object - properties: - hash: - type: string - name: - type: string - content: - type: array - items: - anyOf: - - 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: - - hash - - content - required: - - type - - file - description: File annotation with content - URLCitationAnnotationDetail: + - file_id + - filename + - index + example: + type: file_citation + file_id: file-abc123 + filename: research_paper.pdf + index: 0 + URLCitationAnnotation: type: object properties: type: type: string enum: - url_citation - url_citation: - type: object - properties: - end_index: - type: number - start_index: - type: number - title: - type: string - url: - type: string - content: - type: string - required: - - end_index - - start_index - - title - - url + end_index: + type: number + start_index: + type: number + title: + type: string + url: + type: string required: - type - - url_citation - description: URL citation annotation - AnnotationDetail: - oneOf: - - $ref: '#/components/schemas/FileAnnotationDetail' - - $ref: '#/components/schemas/URLCitationAnnotationDetail' - discriminator: - propertyName: type - mapping: - file: '#/components/schemas/FileAnnotationDetail' - url_citation: '#/components/schemas/URLCitationAnnotationDetail' - description: Annotation information - ChatCompletionMessage: + - end_index + - start_index + - title + - url + example: + type: url_citation + start_index: 0 + end_index: 42 + title: OpenRouter Documentation + url: https://openrouter.ai/docs + FilePathAnnotation: type: object properties: - role: + type: type: string enum: - - assistant - content: + - file_path + file_id: type: string - nullable: true - description: Message content - reasoning: + index: + type: number + required: + - type + - file_id + - index + example: + type: file_path + file_id: file-xyz789 + index: 0 + OutputTextContent: + type: object + properties: + type: type: string - nullable: true - description: Reasoning output - refusal: + enum: + - output_text + text: type: string - nullable: true - description: Refusal message if content was refused - tool_calls: - type: array - items: - $ref: '#/components/schemas/ChatCompletionMessageToolCall' - description: Tool calls made by the assistant - reasoning_details: - type: array - items: - $ref: '#/components/schemas/ReasoningDetail' - description: Reasoning details delta to send reasoning details back to upstream annotations: type: array items: - $ref: '#/components/schemas/AnnotationDetail' - description: Annotations delta to send annotations back to upstream + anyOf: + - $ref: '#/components/schemas/FileCitationAnnotation' + - $ref: '#/components/schemas/URLCitationAnnotation' + - $ref: '#/components/schemas/FilePathAnnotation' required: - - role - - content - - refusal - description: Assistant message in completion response - ChatCompletionTokenLogprob: + - 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 + RefusalContent: type: object properties: - token: + type: 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 - ChatCompletionTokenLogprobs: - type: object - nullable: true - properties: - content: - type: array - nullable: true - items: - $ref: '#/components/schemas/ChatCompletionTokenLogprob' - description: Log probabilities for content tokens - refusal: - type: array - nullable: true - items: - $ref: '#/components/schemas/ChatCompletionTokenLogprob' - description: Log probabilities for refusal tokens - required: - - content - - refusal - description: Log probabilities for the completion - ChatCompletionChoice: - type: object - properties: - finish_reason: - x-speakeasy-unknown-values: allow - type: string - nullable: true enum: - - tool_calls - - stop - - length - - content_filter - - error - description: Reason the completion finished - index: - type: number - description: Choice index - message: - $ref: '#/components/schemas/ChatCompletionMessage' - logprobs: - $ref: '#/components/schemas/ChatCompletionTokenLogprobs' + - refusal + refusal: + type: string required: - - finish_reason - - index - - message - description: Chat completion choice - CompletionUsage: - 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 - properties: - reasoning_tokens: - type: number - description: Tokens used for reasoning - audio_tokens: - type: number - description: Tokens used for audio output - accepted_prediction_tokens: - type: number - description: Accepted prediction tokens - rejected_prediction_tokens: - type: number - description: Rejected prediction tokens - description: Detailed completion token usage - prompt_tokens_details: - type: object - properties: - cached_tokens: - type: number - description: Cached prompt tokens - audio_tokens: - type: number - description: Audio input tokens - description: Detailed prompt token usage - required: - - completion_tokens - - prompt_tokens - - total_tokens - description: Token usage statistics - ChatCompletion: + - type + - refusal + example: + type: refusal + refusal: I'm sorry, I cannot assist with that request + OutputMessage: type: object properties: id: type: string - description: Unique completion identifier - choices: - type: array - items: - $ref: '#/components/schemas/ChatCompletionChoice' - description: List of completion choices - created: - type: number - description: Unix timestamp of creation - model: - type: string - description: Model used for completion - object: + role: type: string enum: - - chat.completion - system_fingerprint: + - assistant + type: type: string - description: System fingerprint - nullable: true - usage: - $ref: '#/components/schemas/CompletionUsage' - required: - - id - - choices - - created - - model - - object - description: Chat completion response - ChatCompletionError: - type: object - properties: - error: - type: object - properties: - code: - type: number - nullable: true - message: - type: string - param: - type: string - nullable: true - type: - type: string - required: - - code + enum: - message - description: Error object structure - required: - - error - description: Chat completion error response - ChatCompletionChunkChoiceDeltaToolCall: - type: object - properties: - index: - type: number - description: Tool call index in the array - id: - type: string - description: Tool call identifier - type: - type: string - enum: - - function - description: Tool call type - function: - type: object - properties: - name: - type: string - description: Function name - arguments: - type: string - description: Function arguments as JSON string - description: Function call details - required: - - index - description: Tool call delta for streaming responses - ChatCompletionChunkChoiceDelta: - type: object - properties: - role: - type: string - enum: - - assistant - description: The role of the message author + status: + anyOf: + - type: string + enum: + - completed + - type: string + enum: + - incomplete + - type: string + enum: + - in_progress content: - type: string - nullable: true - description: Message content delta - reasoning: - type: string - nullable: true - description: Reasoning content delta - refusal: - type: string - nullable: true - description: Refusal message delta - tool_calls: type: array items: - $ref: '#/components/schemas/ChatCompletionChunkChoiceDeltaToolCall' - description: Tool calls delta - reasoning_details: - type: array - items: - $ref: '#/components/schemas/ReasoningDetail' - description: Reasoning details delta to send reasoning details back to upstream - annotations: - type: array - items: - $ref: '#/components/schemas/AnnotationDetail' - description: Annotations delta to send annotations back to upstream - description: Delta changes in streaming response - ChatCompletionChunkChoice: - type: object - properties: - delta: - $ref: '#/components/schemas/ChatCompletionChunkChoiceDelta' - finish_reason: - x-speakeasy-unknown-values: allow - type: string - nullable: true - enum: - - tool_calls - - stop - - length - - content_filter - - error - index: - type: number - logprobs: - $ref: '#/components/schemas/ChatCompletionTokenLogprobs' - required: - - delta - - finish_reason - - index - description: Streaming completion choice chunk - ChatCompletionChunk: - type: object - properties: - id: - type: string - choices: - type: array - items: - $ref: '#/components/schemas/ChatCompletionChunkChoice' - created: - type: number - model: - type: string - object: - type: string - enum: - - chat.completion.chunk - system_fingerprint: - type: string - nullable: true - usage: - $ref: '#/components/schemas/CompletionUsage' + anyOf: + - $ref: '#/components/schemas/OutputTextContent' + - $ref: '#/components/schemas/RefusalContent' required: - id - - choices - - created - - model - - object - description: Streaming chat completion chunk - ChatCompletionRole: - type: string - enum: - - system - - user - - assistant - - tool - - developer - description: The role of the message author - ChatCompletionContentPartText: + - role + - type + - status + - content + example: + id: msg-abc123 + role: assistant + type: message + status: completed + content: + - type: output_text + text: Hello! How can I help you today? + ReasoningTextContent: type: object properties: type: type: string enum: - - text + - reasoning_text text: type: string required: - type - text - description: Text content part - ChatCompletionContentPartImage: + example: + type: reasoning_text + text: Let me think step by step about this problem... + ReasoningSummaryText: 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 + - summary_text + text: + type: string required: - type - - image_url - description: Image content part for vision models - ChatCompletionContentPartAudio: + - text + example: + type: summary_text + text: Analyzed the problem using first principles + OutputItemReasoning: type: object properties: type: type: string enum: - - input_audio - input_audio: + - 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 + required: + - type + - id + - summary + example: + type: reasoning + id: reasoning-abc123 + summary: + - type: summary_text + text: Analyzed the problem using first principles + OutputItemFunctionCall: + type: object + properties: + type: + type: string + enum: + - function_call + id: + type: string + name: + type: string + arguments: + type: string + call_id: + type: string + 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 + 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 + status: + $ref: '#/components/schemas/WebSearchStatus' + required: + - type + - id + - status + example: + type: web_search_call + id: search-abc123 + 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 + 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 + status: + $ref: '#/components/schemas/ImageGenerationStatus' + required: + - type + - id + - result + - status + example: + type: image_generation_call + id: imagegen-abc123 + result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + status: completed + ResponsesOutputItem: + anyOf: + - allOf: + - $ref: '#/components/schemas/OutputMessage' + - type: object + properties: {} + example: + id: msg-abc123 + role: assistant + type: message + status: completed + content: + - type: output_text + text: Hello! How can I help you today? + - allOf: + - $ref: '#/components/schemas/OutputItemReasoning' + - type: object + properties: {} + example: + type: reasoning + id: reasoning-abc123 + summary: + - type: summary_text + text: Analyzed the problem using first principles + - 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 + - allOf: + - $ref: '#/components/schemas/OutputItemWebSearchCall' + - type: object + properties: {} + example: + type: web_search_call + id: search-abc123 + status: completed + - allOf: + - $ref: '#/components/schemas/OutputItemFileSearchCall' + - type: object + properties: {} + example: + type: file_search_call + id: filesearch-abc123 + queries: + - machine learning algorithms + - neural networks + status: completed + - allOf: + - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - type: object + properties: {} + example: + type: image_generation_call + id: imagegen-abc123 + result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + status: completed + 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 + 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. + ResponsesUsage: + type: object + properties: + input_tokens: + type: number + input_tokens_details: type: object properties: - data: + 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 + 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 + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + 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 + OpenResponsesReasoning: + allOf: + - $ref: '#/components/schemas/OutputItemReasoning' + - type: object + properties: + signature: type: string - description: Base64 encoded audio data + nullable: true format: - x-speakeasy-unknown-values: allow type: string + nullable: true enum: - - wav - - mp3 - - flac - - m4a - - ogg - - pcm16 - - pcm24 - description: Audio format - required: - - data - - format + - unknown + - openai-responses-v1 + - xai-responses-v1 + - anthropic-claude-v1 + description: Reasoning output item with signature and format extensions + example: + type: reasoning + id: reasoning-abc123 + summary: + - type: summary_text + text: Step by step analysis + OpenResponsesInputText: + type: object + properties: + type: + type: string + enum: + - input_text + text: + type: string required: - type - - input_audio - description: Audio input content part - ChatCompletionContentPart: + - text + description: Text input content item + example: + type: input_text + text: Hello, how can I help you? + OpenResponsesInputImage: + 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 + OpenResponsesInputFile: + 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 + OpenResponsesInputContent: oneOf: - - $ref: '#/components/schemas/ChatCompletionContentPartText' - - $ref: '#/components/schemas/ChatCompletionContentPartImage' - - $ref: '#/components/schemas/ChatCompletionContentPartAudio' + - $ref: '#/components/schemas/OpenResponsesInputText' + - $ref: '#/components/schemas/OpenResponsesInputImage' + - $ref: '#/components/schemas/OpenResponsesInputFile' discriminator: propertyName: type mapping: - text: '#/components/schemas/ChatCompletionContentPartText' - image_url: '#/components/schemas/ChatCompletionContentPartImage' - input_audio: '#/components/schemas/ChatCompletionContentPartAudio' - description: Content part for chat completion messages - ChatCompletionSystemMessageParam: + input_text: '#/components/schemas/OpenResponsesInputText' + input_image: '#/components/schemas/OpenResponsesInputImage' + input_file: '#/components/schemas/OpenResponsesInputFile' + description: Content item in a response input message + example: + type: input_text + text: Hello, how can I help you? + OpenResponsesEasyInputMessage: type: object properties: - role: + type: type: string enum: - - system - content: + - message + role: anyOf: - type: string + enum: + - user + - type: string + enum: + - system + - type: string + enum: + - assistant + - type: string + enum: + - developer + content: + anyOf: - type: array items: - $ref: '#/components/schemas/ChatCompletionContentPartText' - description: System message content - name: - type: string - description: Optional name for the system message + $ref: '#/components/schemas/OpenResponsesInputContent' + - type: string required: - role - content - description: System message for setting behavior - ChatCompletionUserMessageParam: + description: Simplified input message format that accepts string or array content + example: + role: user + content: What is the weather today? + OpenResponsesInputMessageItem: type: object properties: - role: + id: + type: string + type: type: string enum: - - user - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/ChatCompletionContentPart' - description: User message content - name: - type: string - description: Optional name for the user - required: - - role - - content - description: User message - ChatCompletionAssistantMessageParam: - type: object - properties: + - message role: - type: string - enum: - - assistant - content: anyOf: - type: string - - type: array - items: - $ref: '#/components/schemas/ChatCompletionContentPart' - - nullable: true - description: Assistant message content - name: - type: string - description: Optional name for the assistant - tool_calls: + enum: + - user + - type: string + enum: + - system + - type: string + enum: + - developer + content: type: array items: - $ref: '#/components/schemas/ChatCompletionMessageToolCall' - description: Tool calls made by the assistant - refusal: - type: string - nullable: true - description: Refusal message if content was refused - required: - - role - description: Assistant message with tool calls and audio support - ChatCompletionToolMessageParam: - type: object - properties: - role: - type: string - enum: - - tool - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/ChatCompletionContentPart' - description: Tool response content - tool_call_id: - type: string - description: ID of the tool call this message responds to + $ref: '#/components/schemas/OpenResponsesInputContent' required: + - id - role - content - - tool_call_id - description: Tool response message - ChatCompletionMessageParam: - oneOf: - - $ref: '#/components/schemas/ChatCompletionSystemMessageParam' - - $ref: '#/components/schemas/ChatCompletionUserMessageParam' - - $ref: '#/components/schemas/ChatCompletionAssistantMessageParam' - - $ref: '#/components/schemas/ChatCompletionToolMessageParam' - discriminator: - propertyName: role - mapping: - system: '#/components/schemas/ChatCompletionSystemMessageParam' - user: '#/components/schemas/ChatCompletionUserMessageParam' - assistant: '#/components/schemas/ChatCompletionAssistantMessageParam' - tool: '#/components/schemas/ChatCompletionToolMessageParam' - description: Chat completion message with role-based discrimination - ChatCompletionTool: + description: Input message item with structured content array + example: + id: msg-abc123 + type: message + role: user + content: + - type: input_text + text: What is the weather today? + ToolCallStatus: + type: string + enum: + - in_progress + - completed + - incomplete + example: completed + OpenResponsesFunctionToolCall: 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) - description: - type: string - description: Function description for the model - parameters: - type: object + - function_call + call_id: + type: string + name: + type: string + arguments: + type: string + id: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + 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 + OpenResponsesFunctionCallOutput: + type: object + properties: + type: + type: string + enum: + - function_call_output + id: + type: string + call_id: + type: string + output: + type: string + status: + $ref: '#/components/schemas/ToolCallStatus' + required: + - type + - id + - 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 + OpenResponsesInputItem: + anyOf: + - $ref: '#/components/schemas/OpenResponsesReasoning' + - $ref: '#/components/schemas/OpenResponsesEasyInputMessage' + - $ref: '#/components/schemas/OpenResponsesInputMessageItem' + - $ref: '#/components/schemas/OpenResponsesFunctionToolCall' + - $ref: '#/components/schemas/OpenResponsesFunctionCallOutput' + - allOf: + - $ref: '#/components/schemas/OutputMessage' + - type: object properties: {} - description: Function parameters as JSON Schema object - strict: - type: boolean - nullable: true - description: Enable strict schema adherence - required: - - name - description: Function definition for tool calling - required: - - type - - function - description: Tool definition for function calling - ChatCompletionNamedToolChoice: - type: object - properties: - type: - type: string - enum: - - function - function: - type: object - properties: - name: - type: string - description: Function name to call - required: - - name - required: - - type - - function - description: Named tool choice for specific function - ChatCompletionToolChoiceOption: + example: + id: msg-abc123 + role: assistant + type: message + status: completed + content: + - type: output_text + text: Hello! How can I help you today? + - allOf: + - $ref: '#/components/schemas/OutputItemReasoning' + - type: object + properties: {} + example: + type: reasoning + id: reasoning-abc123 + summary: + - type: summary_text + text: Analyzed the problem using first principles + - 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 + - allOf: + - $ref: '#/components/schemas/OutputItemWebSearchCall' + - type: object + properties: {} + example: + type: web_search_call + id: search-abc123 + status: completed + - allOf: + - $ref: '#/components/schemas/OutputItemFileSearchCall' + - type: object + properties: {} + example: + type: file_search_call + id: filesearch-abc123 + queries: + - machine learning algorithms + - neural networks + status: completed + - allOf: + - $ref: '#/components/schemas/OutputItemImageGenerationCall' + - type: object + properties: {} + example: + type: image_generation_call + id: imagegen-abc123 + result: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + status: completed + description: An item in the input array for a response request + example: + role: user + content: What is the weather today? + OpenResponsesInput: anyOf: - type: string + - type: array + items: + $ref: '#/components/schemas/OpenResponsesInputItem' + - nullable: true + description: Input for a response request - can be a string or array of items + example: + - role: user + content: What is the weather today? + OpenResponsesRequestMetadata: + 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 + OpenResponsesFunctionTool: + type: object + properties: + type: + type: string enum: - - none + - 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 + ResponsesSearchContextSize: + type: string + enum: + - low + - medium + - high + description: Size of the search context for web search tools + example: medium + ResponsesWebSearchUserLocation: + 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 + description: User location information for web search + example: + type: approximate + city: San Francisco + country: USA + region: California + timezone: America/Los_Angeles + OpenResponsesWebSearchPreviewTool: + type: object + properties: + type: + type: string + enum: + - web_search_preview + search_context_size: + $ref: '#/components/schemas/ResponsesSearchContextSize' + user_location: + $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + required: + - type + description: Web search preview tool configuration + example: + type: web_search_preview + OpenResponsesWebSearchPreview20250311Tool: + type: object + properties: + type: + type: string + enum: + - web_search_preview_2025_03_11 + search_context_size: + $ref: '#/components/schemas/ResponsesSearchContextSize' + user_location: + $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + required: + - type + description: Web search preview tool configuration (2025-03-11 version) + example: + type: web_search_preview_2025_03_11 + OpenResponsesWebSearchTool: + type: object + properties: + type: + type: string + enum: + - web_search + filters: + type: object + nullable: true + properties: + allowed_domains: + type: array + nullable: true + items: + type: string + search_context_size: + $ref: '#/components/schemas/ResponsesSearchContextSize' + user_location: + $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + required: + - type + description: Web search tool configuration + example: + type: web_search + filters: + allowed_domains: + - example.com + OpenResponsesWebSearch20250826Tool: + 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 + search_context_size: + $ref: '#/components/schemas/ResponsesSearchContextSize' + user_location: + $ref: '#/components/schemas/ResponsesWebSearchUserLocation' + required: + - type + description: Web search tool configuration (2025-08-26 version) + example: + type: web_search_2025_08_26 + filters: + allowed_domains: + - example.com + OpenResponsesToolUnion: + oneOf: + - allOf: + - $ref: '#/components/schemas/OpenResponsesFunctionTool' + - 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/OpenResponsesWebSearchPreviewTool' + - $ref: '#/components/schemas/OpenResponsesWebSearchPreview20250311Tool' + - $ref: '#/components/schemas/OpenResponsesWebSearchTool' + - $ref: '#/components/schemas/OpenResponsesWebSearch20250826Tool' + description: Union of all supported tool definitions + 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 + ToolChoiceTypes: + type: object + properties: + type: + anyOf: + - type: string + enum: + - file_search + - type: string + enum: + - web_search_preview + - type: string + enum: + - web_search_preview_2025_03_11 + - type: string + enum: + - computer_use_preview + - type: string + enum: + - code_interpreter + required: + - type + description: Force the model to call a tool of a specific type + example: + type: web_search_preview + ToolChoiceFunction: + type: object + properties: + type: + type: string + enum: + - function + name: + type: string + required: + - type + - name + description: Force the model to call a specific function + example: + type: function + name: get_weather + OpenResponsesToolChoice: + anyOf: - type: string enum: - auto + - type: string + enum: + - none - type: string enum: - required - - $ref: '#/components/schemas/ChatCompletionNamedToolChoice' - description: Tool choice configuration - ChatCompletionStreamOptions: - type: object - properties: - include_usage: - type: boolean - description: Include usage information in streaming response - description: Streaming configuration options - ResponseFormatJsonSchemaSchema: - type: object - properties: {} - description: The schema for the response format, described as a JSON Schema object - ChatCompletionCreateParams: - type: object - properties: - messages: - type: array - items: - $ref: '#/components/schemas/ChatCompletionMessageParam' - minItems: 1 - description: List of messages for the conversation + - $ref: '#/components/schemas/ToolChoiceTypes' + - allOf: + - $ref: '#/components/schemas/ToolChoiceFunction' + - type: object + properties: {} + description: Force the model to call a specific function example: - - role: user - content: Hello, how are you? - model: + type: function + name: get_weather + description: Controls which tool the model should call + example: auto + OpenResponsesPrompt: + type: object + nullable: true + properties: + id: type: string - description: Model to use for completion - frequency_penalty: - type: number - nullable: true - minimum: -2 - maximum: 2 - description: Frequency penalty (-2.0 to 2.0) - logit_bias: + variables: type: object nullable: true additionalProperties: - type: number - description: Token logit bias adjustments - logprobs: - type: boolean - nullable: true - description: Return log probabilities - top_logprobs: - type: number - nullable: true - minimum: 0 - maximum: 20 - description: Number of top log probabilities to return (0-20) - max_completion_tokens: - type: number - nullable: true - minimum: 1 - description: Maximum tokens in completion - max_tokens: - type: number - nullable: true - minimum: 1 - description: Maximum tokens (deprecated, use max_completion_tokens) - metadata: - type: object - additionalProperties: - type: string - description: Key-value pairs for additional object information (max 16 pairs, 64 char keys, 512 char values) - presence_penalty: - type: number - nullable: true - minimum: -2 - maximum: 2 - description: Presence penalty (-2.0 to 2.0) - reasoning: - type: object - nullable: true - properties: - enabled: - type: boolean - description: Enables reasoning with default settings. Only work for some models. - effort: - type: string - nullable: true - enum: - - high - - medium - - low - - minimal - description: OpenAI-style reasoning effort setting - max_tokens: - type: number - nullable: true - description: non-OpenAI-style reasoning effort setting - exclude: - type: boolean - default: false - description: Reasoning configuration - response_format: - oneOf: - - type: object - properties: - type: - type: string - enum: - - text - required: - - type - description: Default text response format - - type: object - properties: - type: - type: string - enum: - - json_object - required: - - type - description: JSON object response format - - type: object - properties: - type: - type: string - enum: - - json_schema - json_schema: - type: object - properties: - name: - type: string - maxLength: 64 - description: Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars) - description: - type: string - description: Schema description for the model - schema: - $ref: '#/components/schemas/ResponseFormatJsonSchemaSchema' - strict: - type: boolean - nullable: true - description: Enable strict schema adherence - required: - - name - required: - - type - - json_schema - description: JSON Schema response format for structured outputs - - type: object - properties: - type: - type: string - enum: - - grammar - grammar: - type: string - description: Custom grammar for text generation - required: - - type - - grammar - description: Custom grammar response format - - type: object - properties: - type: - type: string - enum: - - python - required: - - type - description: Python code response format - description: Response format configuration - seed: - type: integer - nullable: true - description: Random seed for deterministic outputs - stop: - anyOf: - - type: string - - type: array - items: - type: string - maxItems: 4 - - nullable: true - description: Stop sequences (up to 4) - stream: - type: boolean - nullable: true - default: false - description: Enable streaming response - stream_options: - allOf: - - $ref: '#/components/schemas/ChatCompletionStreamOptions' - - nullable: true - temperature: - type: number - nullable: true - minimum: 0 - maximum: 2 - default: 1 - description: Sampling temperature (0-2) - tool_choice: - $ref: '#/components/schemas/ChatCompletionToolChoiceOption' - tools: - type: array - items: - $ref: '#/components/schemas/ChatCompletionTool' - description: Available tools for function calling - top_p: - type: number - nullable: true - minimum: 0 - maximum: 1 - default: 1 - description: Nucleus sampling parameter (0-1) - user: - type: string - description: Unique user identifier - models: - # Needed to avoid conflict with the `models` directory - x-speakeasy-name-override: fallback_models - type: array - nullable: true - items: - type: string - description: Order of models to fallback to for this request - reasoning_effort: + $ref: '#/components/schemas/OpenResponsesInputContent' + required: + - id + description: Prompt template with variables for the response + example: + id: prompt-abc123 + variables: + name: + type: input_text + text: John + ReasoningSummaryVerbosity: + type: string + enum: + - auto + - concise + - detailed + OpenResponsesReasoningConfig: + type: object + nullable: true + properties: + effort: type: string nullable: true enum: @@ -1083,7 +1133,2024 @@ components: - medium - low - minimal - description: Reasoning effort + summary: + $ref: '#/components/schemas/ReasoningSummaryVerbosity' + max_tokens: + type: number + nullable: true + enabled: + type: boolean + nullable: true + description: Configuration for reasoning mode in the response + example: + summary: auto + enabled: true + OpenResponsesFormatText: + type: object + properties: + type: + type: string + enum: + - text + required: + - type + description: Plain text response format + example: + type: text + OpenResponsesFormatJSONObject: + type: object + properties: + type: + type: string + enum: + - json_object + required: + - type + description: JSON object response format + example: + type: json_object + OpenResponsesFormatJSONSchema: + 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 + OpenResponsesFormatTextConfig: + anyOf: + - $ref: '#/components/schemas/OpenResponsesFormatText' + - $ref: '#/components/schemas/OpenResponsesFormatJSONObject' + - $ref: '#/components/schemas/OpenResponsesFormatJSONSchema' + description: Text response format configuration + example: + type: text + OpenResponsesTextConfig: + type: object + properties: + format: + $ref: '#/components/schemas/OpenResponsesFormatTextConfig' + verbosity: + type: string + nullable: true + enum: + - high + - low + - medium + description: Text output configuration including format and verbosity + example: + format: + type: text + verbosity: medium + OpenResponsesNonStreamingResponse: + type: object + properties: + id: + type: string + object: + type: string + enum: + - response + created_at: + type: number + model: + type: string + status: + type: string + enum: + - completed + - incomplete + - in_progress + - failed + - cancelled + - queued + output: + type: array + items: + $ref: '#/components/schemas/ResponsesOutputItem' + 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: + type: object + nullable: true + properties: + reason: + type: string + enum: + - max_output_tokens + - content_filter + usage: + $ref: '#/components/schemas/ResponsesUsage' + 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 + instructions: + $ref: '#/components/schemas/OpenResponsesInput' + metadata: + $ref: '#/components/schemas/OpenResponsesRequestMetadata' + tools: + type: array + items: + $ref: '#/components/schemas/OpenResponsesToolUnion' + tool_choice: + $ref: '#/components/schemas/OpenResponsesToolChoice' + parallel_tool_calls: + type: boolean + prompt: + $ref: '#/components/schemas/OpenResponsesPrompt' + background: + type: boolean + nullable: true + previous_response_id: + type: string + nullable: true + reasoning: + $ref: '#/components/schemas/OpenResponsesReasoningConfig' + service_tier: + type: string + nullable: true + enum: + - auto + - default + - flex + - priority + - scale + store: + type: boolean + truncation: + type: string + nullable: true + enum: + - auto + - disabled + text: + $ref: '#/components/schemas/OpenResponsesTextConfig' + required: + - object + - created_at + - model + - output + - error + - incomplete_details + - temperature + - top_p + - instructions + - metadata + - tools + - tool_choice + - parallel_tool_calls + 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 + OpenResponsesCreatedEvent: + type: object + properties: + type: + type: string + enum: + - response.created + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + 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 + OpenResponsesInProgressEvent: + type: object + properties: + type: + type: string + enum: + - response.in_progress + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + 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 + OpenResponsesCompletedEvent: + type: object + properties: + type: + type: string + enum: + - response.completed + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + 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 + OpenResponsesIncompleteEvent: + type: object + properties: + type: + type: string + enum: + - response.incomplete + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + 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 + OpenResponsesFailedEvent: + type: object + properties: + type: + type: string + enum: + - response.failed + response: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + 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 + OpenResponsesErrorEvent: + 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 + OpenResponsesOutputItemAddedEvent: + 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 + OpenResponsesOutputItemDoneEvent: + 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 + OpenResponsesOutputText: + allOf: + - $ref: '#/components/schemas/OutputTextContent' + - type: object + properties: {} + 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 + OpenResponsesRefusalContent: + allOf: + - $ref: '#/components/schemas/RefusalContent' + - type: object + properties: {} + example: + type: refusal + refusal: I'm sorry, I cannot assist with that request + OpenResponsesContentPartAddedEvent: + 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/OpenResponsesOutputText' + - $ref: '#/components/schemas/OpenResponsesRefusalContent' + 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 + OpenResponsesContentPartDoneEvent: + 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/OpenResponsesOutputText' + - $ref: '#/components/schemas/OpenResponsesRefusalContent' + 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 + OpenResponsesTopLogprobs: + type: object + properties: + token: + type: string + logprob: + 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: + allOf: + - $ref: '#/components/schemas/OpenResponsesTopLogprobs' + - type: object + properties: {} + description: Alternative token with its log probability + example: + token: hello + logprob: -0.5 + required: + - logprob + - token + description: Log probability information for a token + example: + logprob: -0.1 + token: world + top_logprobs: + - token: hello + logprob: -0.5 + OpenResponsesTextDeltaEvent: + 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 + OpenResponsesTextDoneEvent: + 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: [] + OpenResponsesRefusalDeltaEvent: + 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 + OpenResponsesRefusalDoneEvent: + 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 + OpenResponsesOutputTextAnnotationAddedEvent: + 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: + anyOf: + - $ref: '#/components/schemas/FileCitationAnnotation' + - $ref: '#/components/schemas/URLCitationAnnotation' + - $ref: '#/components/schemas/FilePathAnnotation' + 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 + OpenResponsesFunctionCallArgumentsDeltaEvent: + 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 + OpenResponsesFunctionCallArgumentsDoneEvent: + 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 + OpenResponsesReasoningDeltaEvent: + 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 + OpenResponsesReasoningDoneEvent: + 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 + OpenResponsesReasoningSummaryPartAddedEventSchema: + 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 + OpenResponsesReasoningSummaryPartDoneEvent: + 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 + OpenResponsesReasoningSummaryTextDeltaEvent: + 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 + OpenResponsesReasoningSummaryTextDoneEvent: + 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 + OpenResponsesImageGenCallInProgress: + 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 + example: + type: response.image_generation_call.in_progress + item_id: item-abc123 + output_index: 0 + sequence_number: 1 + OpenResponsesImageGenCallGenerating: + 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 + example: + type: response.image_generation_call.generating + item_id: item-abc123 + output_index: 0 + sequence_number: 2 + OpenResponsesImageGenCallPartialImage: + 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 + example: + type: response.image_generation_call.partial_image + item_id: item-abc123 + output_index: 0 + sequence_number: 3 + partial_image_b64: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJ + partial_image_index: 0 + OpenResponsesImageGenCallCompleted: + 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 + example: + type: response.image_generation_call.completed + item_id: item-abc123 + output_index: 0 + sequence_number: 4 + OpenResponsesStreamEvent: + oneOf: + - allOf: + - $ref: '#/components/schemas/OpenResponsesCreatedEvent' + - type: object + properties: {} + 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/OpenResponsesInProgressEvent' + - type: object + properties: {} + 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/OpenResponsesCompletedEvent' + - type: object + properties: {} + 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/OpenResponsesIncompleteEvent' + - type: object + properties: {} + 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/OpenResponsesFailedEvent' + - type: object + properties: {} + 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesErrorEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesOutputItemAddedEvent' + - type: object + properties: + item: + $ref: '#/components/schemas/ResponsesOutputItem' + 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/OpenResponsesOutputItemDoneEvent' + - type: object + properties: + item: + $ref: '#/components/schemas/ResponsesOutputItem' + 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesContentPartAddedEvent' + - type: object + properties: + part: + anyOf: + - $ref: '#/components/schemas/OpenResponsesOutputText' + - $ref: '#/components/schemas/ReasoningTextContent' + - $ref: '#/components/schemas/OpenResponsesRefusalContent' + 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesContentPartDoneEvent' + - type: object + properties: + part: + anyOf: + - $ref: '#/components/schemas/OpenResponsesOutputText' + - $ref: '#/components/schemas/ReasoningTextContent' + - $ref: '#/components/schemas/OpenResponsesRefusalContent' + 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesTextDeltaEvent' + - type: object + properties: {} + 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesTextDoneEvent' + - type: object + properties: {} + 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: [] + - allOf: + - $ref: '#/components/schemas/OpenResponsesRefusalDeltaEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesRefusalDoneEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesOutputTextAnnotationAddedEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesFunctionCallArgumentsDeltaEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesFunctionCallArgumentsDoneEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningDeltaEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningDoneEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningSummaryPartAddedEventSchema' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningSummaryPartDoneEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningSummaryTextDeltaEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesReasoningSummaryTextDoneEvent' + - 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 + - allOf: + - $ref: '#/components/schemas/OpenResponsesImageGenCallInProgress' + - type: object + properties: {} + example: + type: response.image_generation_call.in_progress + item_id: item-abc123 + output_index: 0 + sequence_number: 1 + - allOf: + - $ref: '#/components/schemas/OpenResponsesImageGenCallGenerating' + - type: object + properties: {} + example: + type: response.image_generation_call.generating + item_id: item-abc123 + output_index: 0 + sequence_number: 2 + - allOf: + - $ref: '#/components/schemas/OpenResponsesImageGenCallPartialImage' + - type: object + properties: {} + example: + type: response.image_generation_call.partial_image + item_id: item-abc123 + output_index: 0 + sequence_number: 3 + partial_image_b64: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJ + partial_image_index: 0 + - allOf: + - $ref: '#/components/schemas/OpenResponsesImageGenCallCompleted' + - type: object + properties: {} + example: + type: response.image_generation_call.completed + item_id: item-abc123 + output_index: 0 + sequence_number: 4 + 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 + ErrorResponse: + type: object + properties: + error: + type: object + properties: + code: + type: integer + enum: + - 100 + - 101 + - 102 + - 200 + - 201 + - 202 + - 203 + - 204 + - 205 + - 206 + - 207 + - 208 + - 300 + - 301 + - 302 + - 303 + - 304 + - 305 + - 307 + - 308 + - 400 + - 401 + - 402 + - 403 + - 404 + - 405 + - 406 + - 407 + - 408 + - 409 + - 410 + - 411 + - 412 + - 413 + - 414 + - 415 + - 416 + - 417 + - 418 + - 422 + - 423 + - 424 + - 425 + - 426 + - 428 + - 429 + - 431 + - 451 + - 498 + - 499 + - 500 + - 501 + - 502 + - 503 + - 504 + - 505 + - 506 + - 507 + - 508 + - 510 + - 511 + - 520 + - 521 + - 522 + - 523 + - 524 + - 525 + - 526 + - 529 + - 530 + message: + type: string + metadata: + type: object + nullable: true + additionalProperties: + nullable: true + required: + - code + - message + user_id: + type: string + nullable: true + required: + - error + description: Error response + example: + error: + code: 400 + message: Invalid request parameters + metadata: + field: temperature + reason: Must be between 0 and 2 + user_id: user-abc123 + OpenResponsesIncludable: + 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 + description: Fields to include in the response that would normally be omitted + example: message.input_image.image_url + OpenResponsesServiceTier: + type: string + nullable: true + enum: + - auto + - default + - flex + - priority + - scale + example: auto + OpenResponsesTruncation: + 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: deny + ProviderName: + type: string + enum: + - AnyScale + - Cent-ML + - HuggingFace + - Hyperbolic 2 + - Lepton + - Lynn 2 + - Lynn + - Mancer + - Modal + - OctoAI + - Recursal + - Reflection + - Replicate + - SambaNova 2 + - SF Compute + - Together 2 + - 01.AI + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - AtlasCloud + - Atoma + - Avian + - Azure + - BaseTen + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - CrofAI + - Crusoe + - DeepInfra + - DeepSeek + - Enfer + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - InoCloud + - Kluster + - Lambda + - Liquid + - Mancer 2 + - Meta + - Minimax + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Nineteen + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Ubicloud + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + example: OpenAI + Quantization: + type: string + enum: + - int4 + - int8 + - fp4 + - fp6 + - fp8 + - fp16 + - bf16 + - fp32 + - unknown + example: fp16 + ProviderSort: + type: string + nullable: true + enum: + - price + - throughput + - latency + description: >- + The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is + performed. + example: price + OpenResponsesRequest: + type: object + properties: + input: + allOf: + - $ref: '#/components/schemas/OpenResponsesInput' + - anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenResponsesInputItem' + instructions: + type: string + nullable: true + metadata: + $ref: '#/components/schemas/OpenResponsesRequestMetadata' + tools: + type: array + items: + $ref: '#/components/schemas/OpenResponsesToolUnion' + tool_choice: + $ref: '#/components/schemas/OpenResponsesToolChoice' + parallel_tool_calls: + type: boolean + nullable: true + model: + type: string + models: + type: array + items: + type: string + text: + $ref: '#/components/schemas/OpenResponsesTextConfig' + reasoning: + $ref: '#/components/schemas/OpenResponsesReasoningConfig' + 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_k: + type: number + prompt_cache_key: + type: string + nullable: true + previous_response_id: + type: string + nullable: true + prompt: + $ref: '#/components/schemas/OpenResponsesPrompt' + include: + type: array + nullable: true + items: + $ref: '#/components/schemas/OpenResponsesIncludable' + background: + type: boolean + nullable: true + safety_identifier: + type: string + nullable: true + store: + type: boolean + nullable: true + service_tier: + $ref: '#/components/schemas/OpenResponsesServiceTier' + truncation: + $ref: '#/components/schemas/OpenResponsesTruncation' + stream: + type: boolean + nullable: true provider: type: object nullable: true @@ -1106,103 +3173,20 @@ components: is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest. data_collection: - type: string + $ref: '#/components/schemas/DataCollection' + zdr: + type: boolean 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. + 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 order: type: array nullable: true items: anyOf: - - type: string - enum: - - AnyScale - - Cent-ML - - HuggingFace - - Hyperbolic 2 - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Modal - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Together 2 - - 01.AI - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - AtlasCloud - - Atoma - - Avian - - Azure - - BaseTen - - Cerebras - - Chutes - - Cloudflare - - Cohere - - CrofAI - - Crusoe - - DeepInfra - - DeepSeek - - Enfer - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - InoCloud - - Kluster - - Lambda - - Liquid - - Mancer 2 - - Meta - - Minimax - - Mistral - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Nineteen - - Novita - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - SambaNova - - Stealth - - Switchpoint - - Targon - - Together - - Ubicloud - - Venice - - WandB - - xAI - - Z.AI + - $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 @@ -1213,86 +3197,7 @@ components: nullable: true items: anyOf: - - type: string - enum: - - AnyScale - - Cent-ML - - HuggingFace - - Hyperbolic 2 - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Modal - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Together 2 - - 01.AI - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - AtlasCloud - - Atoma - - Avian - - Azure - - BaseTen - - Cerebras - - Chutes - - Cloudflare - - Cohere - - CrofAI - - Crusoe - - DeepInfra - - DeepSeek - - Enfer - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - InoCloud - - Kluster - - Lambda - - Liquid - - Mancer 2 - - Meta - - Minimax - - Mistral - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Nineteen - - Novita - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - SambaNova - - Stealth - - Switchpoint - - Targon - - Together - - Ubicloud - - Venice - - WandB - - xAI - - Z.AI + - $ref: '#/components/schemas/ProviderName' - type: string description: >- List of provider slugs to allow. If provided, this list is merged with your account-wide allowed @@ -1302,86 +3207,7 @@ components: nullable: true items: anyOf: - - type: string - enum: - - AnyScale - - Cent-ML - - HuggingFace - - Hyperbolic 2 - - Lepton - - Lynn 2 - - Lynn - - Mancer - - Modal - - OctoAI - - Recursal - - Reflection - - Replicate - - SambaNova 2 - - SF Compute - - Together 2 - - 01.AI - - AI21 - - AionLabs - - Alibaba - - Amazon Bedrock - - Anthropic - - AtlasCloud - - Atoma - - Avian - - Azure - - BaseTen - - Cerebras - - Chutes - - Cloudflare - - Cohere - - CrofAI - - Crusoe - - DeepInfra - - DeepSeek - - Enfer - - Featherless - - Fireworks - - Friendli - - GMICloud - - Google - - Google AI Studio - - Groq - - Hyperbolic - - Inception - - InferenceNet - - Infermatic - - Inflection - - InoCloud - - Kluster - - Lambda - - Liquid - - Mancer 2 - - Meta - - Minimax - - Mistral - - Moonshot AI - - Morph - - NCompass - - Nebius - - NextBit - - Nineteen - - Novita - - OpenAI - - OpenInference - - Parasail - - Perplexity - - Phala - - SambaNova - - Stealth - - Switchpoint - - Targon - - Together - - Ubicloud - - Venice - - WandB - - xAI - - Z.AI + - $ref: '#/components/schemas/ProviderName' - type: string description: >- List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored @@ -1390,28 +3216,10 @@ components: type: array nullable: true items: - type: string - enum: - - int4 - - int8 - - fp4 - - fp6 - - fp8 - - fp16 - - bf16 - - fp32 - - unknown + $ref: '#/components/schemas/Quantization' description: A list of quantization levels to filter the provider by. sort: - type: string - nullable: true - enum: - - price - - throughput - - latency - description: >- - The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing - is performed. + $ref: '#/components/schemas/ProviderSort' max_price: type: object properties: @@ -1444,6 +3252,10 @@ components: description: >- The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion. + experimental: + type: object + nullable: true + properties: {} additionalProperties: false description: When multiple model providers are available, optionally indicate your routing preference. plugins: @@ -1475,14 +3287,6 @@ components: - exa required: - id - - type: object - properties: - id: - type: string - enum: - - chain-of-thought - required: - - id - type: object properties: id: @@ -1503,60 +3307,3564 @@ components: required: - id description: Plugins you want to enable for this request, including their settings. + user: + type: string + maxLength: 128 + 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 128 characters. + 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 + 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 + ModelGroup: + type: string + enum: + - Router + - Media + - Other + - GPT + - Claude + - Gemini + - Grok + - Cohere + - Nova + - Qwen + - Yi + - DeepSeek + - Mistral + - Llama2 + - Llama3 + - Llama4 + - PaLM + - RWKV + - Qwen3 + description: Tokenizer type used by the model + example: GPT + 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 + example: chatml + InputModality: + type: string + enum: + - text + - image + - file + - audio + example: text + OutputModality: + type: string + enum: + - text + - image + - embeddings + example: text + ModelArchitecture: + type: object + properties: + tokenizer: + $ref: '#/components/schemas/ModelGroup' + instruct_type: + $ref: '#/components/schemas/InstructType' + 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 + 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 + - 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 + frequency_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + additionalProperties: false + description: Default parameters for this model + example: + temperature: 0.7 + top_p: 0.9 + frequency_penalty: 0 + 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: + type: object + properties: + prompt: + anyOf: + - type: number + - type: string + - {} + completion: + anyOf: + - type: number + - type: string + - {} + request: + anyOf: + - type: number + - type: string + - {} + image: + anyOf: + - type: number + - type: string + - {} + image_output: + anyOf: + - type: number + - type: string + - {} + audio: + anyOf: + - type: number + - type: string + - {} + input_audio_cache: + anyOf: + - type: number + - type: string + - {} + web_search: + anyOf: + - type: number + - type: string + - {} + internal_reasoning: + anyOf: + - type: number + - type: string + - {} + input_cache_read: + anyOf: + - type: number + - type: string + - {} + input_cache_write: + anyOf: + - type: number + - type: string + - {} + discount: + type: number + required: + - prompt + - completion + additionalProperties: false + description: Pricing information for the model + 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: + type: object + nullable: true + properties: + prompt_tokens: + description: Maximum prompt tokens per request + completion_tokens: + description: Maximum completion tokens per request + required: + - prompt_tokens + - completion_tokens + description: Per-request token limits + supported_parameters: + type: array + items: + $ref: '#/components/schemas/Parameter' + description: List of supported parameters for this model + default_parameters: + $ref: '#/components/schemas/DefaultParameters' + 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 + EndpointStatus: + type: integer + enum: + - 0 + - -1 + - -2 + - -3 + - -5 + - -10 + example: 0 + PublicEndpoint: + type: object + properties: + name: + type: string + model_name: + type: string + context_length: + type: number + pricing: + type: object + properties: + prompt: + anyOf: + - type: number + - type: string + - {} + completion: + anyOf: + - type: number + - type: string + - {} + request: + anyOf: + - type: number + - type: string + - {} + image: + anyOf: + - type: number + - type: string + - {} + image_output: + anyOf: + - type: number + - type: string + - {} + audio: + anyOf: + - type: number + - type: string + - {} + input_audio_cache: + anyOf: + - type: number + - type: string + - {} + web_search: + anyOf: + - type: number + - type: string + - {} + internal_reasoning: + anyOf: + - type: number + - type: string + - {} + input_cache_read: + anyOf: + - type: number + - type: string + - {} + input_cache_write: + anyOf: + - type: number + - type: string + - {} + discount: + type: number + required: + - prompt + - completion + additionalProperties: false + 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 + required: + - name + - model_name + - context_length + - pricing + - provider_name + - tag + - quantization + - max_completion_tokens + - max_prompt_tokens + - supported_parameters + - uptime_last_30m + - supports_implicit_caching + description: Information about a specific model endpoint + example: + 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 + status: 0 + uptime_last_30m: 99.5 + supports_implicit_caching: true + ChatMessageContentItemText: + type: object + properties: + type: + type: string + const: text + text: + type: string + required: + - type + - text + ChatMessageContentItemImage: + type: object + properties: + type: + type: string + const: image_url + image_url: + type: object + properties: + url: + type: string + detail: + type: string + enum: + - auto + - low + - high + required: + - url + required: + - type + - image_url + ChatMessageContentItemAudio: + type: object + properties: + type: + type: string + const: input_audio + input_audio: + type: object + properties: + data: + type: string + format: + type: string + enum: + - wav + - mp3 + - flac + - m4a + - ogg + - pcm16 + - pcm24 + required: + - data + - format + required: + - type + - input_audio + ChatMessageContentItem: + oneOf: + - $ref: '#/components/schemas/ChatMessageContentItemText' + - $ref: '#/components/schemas/ChatMessageContentItemImage' + - $ref: '#/components/schemas/ChatMessageContentItemAudio' + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/ChatMessageContentItemText' + image_url: '#/components/schemas/ChatMessageContentItemImage' + input_audio: '#/components/schemas/ChatMessageContentItemAudio' + ChatMessageToolCall: + type: object + properties: + id: + type: string + type: + type: string + const: function + function: + type: object + properties: + name: + type: string + arguments: + type: string + required: + - name + - arguments + required: + - id + - type + - function + ChatMessageTokenLogprob: + type: object + properties: + token: + type: string + logprob: + type: number + bytes: + type: array + nullable: true + items: + type: number + 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 + required: + - token + - logprob + - bytes + - top_logprobs + ChatMessageTokenLogprobs: + type: object + properties: + content: + type: array + nullable: true + items: + $ref: '#/components/schemas/ChatMessageTokenLogprob' + refusal: + type: array + nullable: true + items: + $ref: '#/components/schemas/ChatMessageTokenLogprob' + required: + - content + - refusal + ChatGenerationTokenUsage: + type: object + properties: + completion_tokens: + type: number + prompt_tokens: + type: number + total_tokens: + type: number + completion_tokens_details: + type: object + properties: + reasoning_tokens: + type: number + audio_tokens: + type: number + accepted_prediction_tokens: + type: number + rejected_prediction_tokens: + type: number + prompt_tokens_details: + type: object + properties: + cached_tokens: + type: number + audio_tokens: + type: number + required: + - completion_tokens + - prompt_tokens + - total_tokens + ChatCompletionFinishReason: + type: string + enum: + - tool_calls + - stop + - length + - content_filter + - error + JSONSchemaConfig: + type: object + properties: + name: + type: string + maxLength: 64 + description: + type: string + schema: + type: object + additionalProperties: {} + strict: + type: boolean + nullable: true + required: + - name + ResponseFormatJSONSchema: + type: object + properties: + type: + type: string + const: json_schema + json_schema: + $ref: '#/components/schemas/JSONSchemaConfig' + required: + - type + - json_schema + ResponseFormatTextGrammar: + type: object + properties: + type: + type: string + const: grammar + grammar: + type: string + required: + - type + - grammar + SystemMessage: + type: object + properties: + role: + type: string + const: system + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ChatMessageContentItemText' + name: + type: string + required: + - role + - content + UserMessage: + type: object + properties: + role: + type: string + const: user + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ChatMessageContentItem' + name: + type: string + required: + - role + - content + AssistantMessage: + type: object + properties: + role: + type: string + const: assistant + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ChatMessageContentItem' + - type: 'null' + name: + type: string + tool_calls: + type: array + items: + $ref: '#/components/schemas/ChatMessageToolCall' + refusal: + type: string + nullable: true + reasoning: + type: string + nullable: true + required: + - role + ToolResponseMessage: + type: object + properties: + role: + type: string + const: tool + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ChatMessageContentItem' + tool_call_id: + type: string + required: + - role + - content + - tool_call_id + Message: + oneOf: + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/UserMessage' + - type: object + properties: + role: + type: string + const: developer + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/ChatMessageContentItemText' + name: + type: string + required: + - role + - content + - $ref: '#/components/schemas/AssistantMessage' + - $ref: '#/components/schemas/ToolResponseMessage' + Tool: + type: object + properties: + type: + type: string + const: function + function: + type: object + properties: + name: + type: string + maxLength: 64 + description: + type: string + parameters: + type: object + additionalProperties: {} + strict: + type: boolean + nullable: true + required: + - name + required: + - type + - function + NamedToolChoice: + type: object + properties: + type: + type: string + const: function + function: + type: object + properties: + name: + type: string + required: + - name + required: + - type + - function + ToolChoiceOption: + anyOf: + - type: string + const: none + - type: string + const: auto + - type: string + const: required + - $ref: '#/components/schemas/NamedToolChoice' + ChatStreamOptions: + type: object + properties: + include_usage: + type: boolean + ChatGenerationParams: + type: object + properties: + messages: + type: array + items: + $ref: '#/components/schemas/Message' + minItems: 1 + model: + type: string + frequency_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + logit_bias: + type: object + nullable: true + additionalProperties: + type: number + logprobs: + type: boolean + nullable: true + top_logprobs: + type: number + nullable: true + minimum: 0 + maximum: 20 + max_completion_tokens: + type: number + nullable: true + minimum: 1 + max_tokens: + type: number + nullable: true + minimum: 1 + metadata: + type: object + additionalProperties: + type: string + presence_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + reasoning: + type: object + properties: + effort: + type: string + nullable: true + enum: + - minimal + - low + - medium + - high + - null + summary: + anyOf: + - $ref: '#/components/schemas/ReasoningSummaryVerbosity' + - type: 'null' + response_format: + oneOf: + - type: object + properties: + type: + type: string + const: text + required: + - type + - type: object + properties: + type: + type: string + const: json_object + required: + - type + - $ref: '#/components/schemas/ResponseFormatJSONSchema' + - $ref: '#/components/schemas/ResponseFormatTextGrammar' + - type: object + properties: + type: + type: string + const: python + required: + - type + seed: + type: integer + nullable: true + stop: + anyOf: + - type: string + - type: array + items: + type: string + maxItems: 4 + - type: 'null' + stream: + type: boolean + nullable: true + default: false + stream_options: + oneOf: + - $ref: '#/components/schemas/ChatStreamOptions' + - type: 'null' + temperature: + type: number + nullable: true + minimum: 0 + maximum: 2 + default: 1 + tool_choice: + $ref: '#/components/schemas/ToolChoiceOption' + tools: + type: array + items: + $ref: '#/components/schemas/Tool' + top_p: + type: number + nullable: true + minimum: 0 + maximum: 1 + default: 1 + user: + type: string required: - messages - description: Chat completion request parameters + - model + ChatResponseChoice: + type: object + properties: + finish_reason: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' + index: + type: number + message: + $ref: '#/components/schemas/AssistantMessage' + logprobs: + oneOf: + - $ref: '#/components/schemas/ChatMessageTokenLogprobs' + - type: 'null' + required: + - finish_reason + - index + - message + ChatResponse: + type: object + properties: + id: + type: string + choices: + type: array + items: + $ref: '#/components/schemas/ChatResponseChoice' + created: + type: number + model: + type: string + object: + type: string + const: chat.completion + system_fingerprint: + type: string + nullable: true + usage: + $ref: '#/components/schemas/ChatGenerationTokenUsage' + required: + - id + - choices + - created + - model + - object + ChatError: + type: object + properties: + error: + type: object + properties: + code: + anyOf: + - type: string + - type: number + - type: 'null' + message: + type: string + param: + type: string + nullable: true + type: + type: string + required: + - code + - message + - param + - type + required: + - error + ChatStreamingMessageToolCall: + type: object + properties: + index: + type: number + id: + type: string + type: + type: string + const: function + function: + type: object + properties: + name: + type: string + arguments: + type: string + required: + - index + ChatStreamingMessageChunk: + type: object + properties: + role: + type: string + enum: + - assistant + content: + type: string + nullable: true + reasoning: + type: string + nullable: true + refusal: + type: string + nullable: true + tool_calls: + type: array + items: + $ref: '#/components/schemas/ChatStreamingMessageToolCall' + ChatStreamingChoice: + type: object + properties: + delta: + $ref: '#/components/schemas/ChatStreamingMessageChunk' + finish_reason: + anyOf: + - $ref: '#/components/schemas/ChatCompletionFinishReason' + - type: 'null' + index: + type: number + logprobs: + oneOf: + - $ref: '#/components/schemas/ChatMessageTokenLogprobs' + - type: 'null' + required: + - delta + - finish_reason + - index + ChatStreamingResponseChunk: + type: object + properties: + data: + type: object + properties: + id: + type: string + choices: + type: array + items: + $ref: '#/components/schemas/ChatStreamingChoice' + created: + type: number + model: + type: string + object: + type: string + const: chat.completion.chunk + system_fingerprint: + type: string + nullable: true + error: + type: object + properties: + message: + type: string + code: + type: number + required: + - message + - code + usage: + $ref: '#/components/schemas/ChatGenerationTokenUsage' + required: + - id + - choices + - created + - model + - object + required: + - data + CompletionFinishReason: + type: string + nullable: true + enum: + - stop + - length + - content_filter + - null + CompletionLogprobs: + type: object + properties: + tokens: + type: array + items: + type: string + token_logprobs: + type: array + items: + type: number + top_logprobs: + type: array + nullable: true + items: + type: object + additionalProperties: + type: number + text_offset: + type: array + items: + type: number + required: + - tokens + - token_logprobs + - top_logprobs + - text_offset + CompletionUsage: + type: object + properties: + prompt_tokens: + type: number + completion_tokens: + type: number + total_tokens: + type: number + required: + - prompt_tokens + - completion_tokens + - total_tokens + CompletionCreateParams: + type: object + properties: + model: + type: string + prompt: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + type: number + - type: array + items: + type: array + items: + type: number + best_of: + type: integer + nullable: true + minimum: 1 + maximum: 20 + echo: + type: boolean + nullable: true + frequency_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + logit_bias: + type: object + nullable: true + additionalProperties: + type: number + logprobs: + type: integer + nullable: true + minimum: 0 + maximum: 5 + max_tokens: + type: integer + nullable: true + minimum: 1 + 'n': + type: integer + nullable: true + minimum: 1 + maximum: 128 + presence_penalty: + type: number + nullable: true + minimum: -2 + maximum: 2 + seed: + type: integer + nullable: true + stop: + anyOf: + - type: string + - type: array + items: + type: string + - type: 'null' + stream: + type: boolean + nullable: true + stream_options: + type: object + nullable: true + properties: + include_usage: + type: boolean + nullable: true + suffix: + type: string + nullable: true + temperature: + type: number + nullable: true + minimum: 0 + maximum: 2 + top_p: + type: number + nullable: true + minimum: 0 + maximum: 1 + user: + type: string + metadata: + type: object + nullable: true + additionalProperties: + type: string + response_format: + oneOf: + - type: object + properties: + type: + type: string + const: text + required: + - type + - type: object + properties: + type: + type: string + const: json_object + required: + - type + - $ref: '#/components/schemas/ResponseFormatJSONSchema' + - $ref: '#/components/schemas/ResponseFormatTextGrammar' + - type: object + properties: + type: + type: string + const: python + required: + - type + - type: 'null' + required: + - model + - prompt + CompletionChoice: + type: object + properties: + text: + type: string + index: + type: number + logprobs: + oneOf: + - $ref: '#/components/schemas/CompletionLogprobs' + - type: 'null' + finish_reason: + $ref: '#/components/schemas/CompletionFinishReason' + required: + - text + - index + - logprobs + - finish_reason + CompletionResponse: + type: object + properties: + id: + type: string + object: + type: string + const: text_completion + created: + type: number + model: + type: string + system_fingerprint: + type: string + choices: + type: array + items: + $ref: '#/components/schemas/CompletionChoice' + usage: + $ref: '#/components/schemas/CompletionUsage' + required: + - id + - object + - created + - model + - choices 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: - /chat/completions: + /api/alpha/responses: post: - operationId: createChatCompletion - x-speakeasy-group: chat - x-speakeasy-name-override: complete - summary: Create a chat completion - description: Creates a model response for the given chat conversation. Supports both streaming and non-streaming modes. + x-speakeasy-name-override: send + x-speakeasy-stream-request-field: stream tags: - - Chat + - beta.responses + summary: Create a response + description: Creates a streaming or non-streaming response using OpenResponses API format requestBody: - description: Chat completion request parameters - required: true content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionCreateParams' + $ref: '#/components/schemas/OpenResponsesRequest' + required: true + responses: + '200': + description: Successful response + content: + application/json: + schema: + $ref: '#/components/schemas/OpenResponsesNonStreamingResponse' + text/event-stream: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/OpenResponsesStreamEvent' + required: + - data + x-speakeasy-sse-sentinel: '[DONE]' + default: + description: Error Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: createApiAlphaResponses + /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 + 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 + 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 + default: + description: Error Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /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 + 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 + example: + data: + total_credits: 100.5 + total_usage: 25.75 + default: + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /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: + type: object + properties: + amount: + type: number + sender: {} + chain_id: + type: integer + enum: + - 1 + - 137 + - 8453 + required: + - amount + - sender + - chain_id + 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 + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /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 + description: Type of API used for the generation + 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 + description: Generation data + required: + - data + description: Generation response + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: getGeneration + /models/count: + get: + tags: + - Models + summary: Get total count of available models + responses: + '200': + description: Returns the total count of available models + content: + application/json: + schema: + 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 + example: + data: + count: 150 + default: + description: Error Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: listModelsCount + /models: + get: + tags: + - Models + summary: List all models and their properties + parameters: + - schema: + type: string + required: false + name: category + in: query + - schema: + type: string + required: false + name: supported_parameters + 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: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Model' + description: List of available models + required: + - data + application/rss+xml: + schema: + type: string + default: + description: Error Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: getModels + /models/user: + get: + tags: + - Models + summary: List models filtered by user provider preferences + security: + - bearer: [] + responses: + '200': + description: Returns a list of models filtered by user provider preferences + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Model' + description: List of available models + required: + - data + default: + description: Error Response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 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: + 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: + type: object + 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 + description: Model architecture information + endpoints: + type: array + items: + $ref: '#/components/schemas/PublicEndpoint' + description: List of available endpoints for this model + required: + - id + - name + - created + - description + - architecture + - endpoints + required: + - data + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /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 + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: listEndpointsZdr + /parameters/{author}/{slug}: + get: + tags: + - Parameters + summary: Get a model's supported parameters and data about which are most popular + security: + - bearer: [] + parameters: + - schema: + type: string + required: true + name: author + in: path + - schema: + type: string + required: true + name: slug + in: path + - schema: + type: string + enum: + - AI21 + - AionLabs + - Alibaba + - Amazon Bedrock + - Anthropic + - AtlasCloud + - Atoma + - Avian + - Azure + - BaseTen + - Cerebras + - Chutes + - Cirrascale + - Clarifai + - Cloudflare + - Cohere + - CrofAI + - Crusoe + - DeepInfra + - DeepSeek + - Enfer + - Featherless + - Fireworks + - Friendli + - GMICloud + - Google + - Google AI Studio + - Groq + - Hyperbolic + - Inception + - InferenceNet + - Infermatic + - Inflection + - Kluster + - Lambda + - Liquid + - Mancer 2 + - Meta + - Minimax + - Mistral + - Modular + - Moonshot AI + - Morph + - NCompass + - Nebius + - NextBit + - Nineteen + - Novita + - Nvidia + - OpenAI + - OpenInference + - Parasail + - Perplexity + - Phala + - Relace + - SambaNova + - SiliconFlow + - Stealth + - Switchpoint + - Targon + - Together + - Ubicloud + - Venice + - WandB + - xAI + - Z.AI + - FakeProvider + required: false + name: provider + in: query + responses: + '200': + description: Returns the parameters for the specified model + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + model: + type: string + description: Model identifier + example: openai/gpt-4 + supported_parameters: + type: array + items: + 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 + - web_search_options + - verbosity + description: List of parameters supported by this model + example: + - temperature + - top_p + - max_tokens + required: + - model + - supported_parameters + description: Parameter analytics data + example: + model: openai/gpt-4 + supported_parameters: + - temperature + - top_p + - max_tokens + required: + - data + example: + data: + model: openai/gpt-4 + supported_parameters: + - temperature + - top_p + - max_tokens + default: + description: Data not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: getParameters + /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 + 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 + required: + - data + '500': + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error: + type: object + properties: + code: + type: number + description: Error code + example: 400 + message: + type: string + description: Error message + example: Bad Request + required: + - code + - message + description: Error details + example: + code: 400 + message: Bad Request + required: + - error + example: + error: + code: 400 + message: Bad Request + /keys: + get: + operationId: list + x-speakeasy-name-override: list + tags: + - API Keys + summary: List API keys + parameters: + - schema: + type: string + description: Whether to include disabled API keys in the response + example: 'false' + required: false + name: include_disabled + in: query + - schema: + type: string + description: Number of API keys to skip for pagination + example: '0' + required: false + 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: 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 + 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: Production API Key + 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' + 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 + example: + hash: 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 + 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' + description: List of API keys + required: + - data + example: + data: + - hash: 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 + 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' + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + post: + x-speakeasy-name-override: create + tags: + - API Keys + summary: Create a new API key + 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 + required: + - name + example: + name: My New API Key + limit: 50 + limit_reset: monthly + include_byok_in_limit: true + 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: 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 + 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: Production API Key + 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' + 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 + description: The created API key information + example: + hash: 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 + 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' + key: + type: string + description: The actual API key string (only shown once) + example: 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 + required: + - data + - key + example: + data: + hash: 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 + 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 + key: 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 + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: createKeys + /keys/{hash}: + patch: + x-speakeasy-name-override: update + tags: + - API Keys + summary: Update an API key + parameters: + - schema: + type: string + description: The hash identifier of the API key to update + example: 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 + required: true + 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: 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 + 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: Production API Key + 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' + 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 + description: The updated API key information + example: + hash: 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 + 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' + required: + - data + example: + data: + hash: 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 + 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' + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: updateKeys + delete: + x-speakeasy-name-override: delete + tags: + - API Keys + summary: Delete an API key + parameters: + - schema: + type: string + description: The hash identifier of the API key to delete + example: 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 + required: true + 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 + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + operationId: deleteKeys + get: + operationId: getKey + x-speakeasy-name-override: get + tags: + - API Keys + summary: Get a single API key + parameters: + - schema: + type: string + description: The hash identifier of the API key to retrieve + example: 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 + required: true + 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: 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 + 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: Production API Key + 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' + 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 + description: The API key information + example: + hash: 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 + 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' + required: + - data + example: + data: + hash: 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 + 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' + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /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: 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 + 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_provisioning_key: + type: boolean + description: Whether this is a provisioning key + 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 + 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_provisioning_key + - limit_remaining + - limit_reset + - include_byok_in_limit + - rate_limit + description: Current API key information + example: + label: sk-or-v1-au78b3456789012345678901234567890 + 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_provisioning_key: false + limit_remaining: 74.5 + limit_reset: monthly + include_byok_in_limit: false + rate_limit: + requests: 1000 + interval: 1h + note: This field is deprecated and safe to ignore. + required: + - data + example: + data: + label: sk-or-v1-au78b3456789012345678901234567890 + 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_provisioning_key: false + limit_remaining: 74.5 + limit_reset: monthly + include_byok_in_limit: false + rate_limit: + requests: 1000 + interval: 1h + note: This field is deprecated and safe to ignore. + default: + description: Error response + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /chat/completions: + post: + summary: Create a chat completion + operationId: sendChatCompletionRequest + x-speakeasy-group: chat + x-speakeasy-name-override: send + x-speakeasy-stream-request-field: stream + description: >- + Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming + modes. + tags: + - Chat + requestBody: + required: true + description: Chat completion request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/ChatGenerationParams' responses: '200': description: Successful chat completion response content: application/json: schema: - $ref: '#/components/schemas/ChatCompletion' - description: Non-streaming response when stream=false + $ref: '#/components/schemas/ChatResponse' + description: Chat completion response text/event-stream: - x-speakeasy-sse-sentinel: '[DONE]' schema: - $ref: '#/components/schemas/ChatCompletionChunkWrapper' + $ref: '#/components/schemas/ChatStreamingResponseChunk' + x-speakeasy-sse-sentinel: '[DONE]' '400': description: Bad request - invalid parameters content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionError' + $ref: '#/components/schemas/ChatError' '401': description: Unauthorized - invalid API key content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionError' + $ref: '#/components/schemas/ChatError' '429': description: Too many requests - rate limit exceeded content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionError' + $ref: '#/components/schemas/ChatError' '500': description: Internal server error content: application/json: schema: - $ref: '#/components/schemas/ChatCompletionError' + $ref: '#/components/schemas/ChatError' + /completions: + post: + summary: Create a completion + x-speakeasy-group: completions + x-speakeasy-name-override: generate + x-speakeasy-stream-request-field: stream + description: Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes. + tags: + - Completions + requestBody: + required: true + description: Completion request parameters + content: + application/json: + schema: + $ref: '#/components/schemas/CompletionCreateParams' + responses: + '200': + description: Successful completion response + content: + application/json: + schema: + $ref: '#/components/schemas/CompletionResponse' + description: Completion response + '400': + description: Bad request - invalid parameters + content: + application/json: + schema: + $ref: '#/components/schemas/ChatError' + '401': + description: Unauthorized - invalid API key + content: + application/json: + schema: + $ref: '#/components/schemas/ChatError' + '429': + description: Too many requests - rate limit exceeded + content: + application/json: + schema: + $ref: '#/components/schemas/ChatError' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ChatError' + operationId: createCompletions +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 +tags: + - name: API Keys + description: API key management endpoints + - name: Analytics + description: Analytics and usage endpoints + - name: Chat + description: Chat completion endpoints + - name: Completions + description: Text completion endpoints + - name: Credits + description: Credit management endpoints + - name: Endpoints + description: Endpoint information + - name: Generations + description: Generation history endpoints + - name: Models + description: Model information endpoints + - name: Parameters + description: Parameters 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