openapi: 3.2.0 info: title: AIML Messages API version: 1.0.0 servers: - url: https://api.aimlapi.com tags: - name: Messages paths: /v1/messages: post: operationId: _v1_messages requestBody: required: true content: application/json: schema: anyOf: - type: object properties: model: type: string enum: - claude-opus-4-1-20250805 - anthropic/claude-opus-4-1-20250805 - claude-sonnet-4-5-20250929 - anthropic/claude-sonnet-4-5-20250929 - claude-haiku-4-5-20251001 - anthropic/claude-haiku-4-5-20251001 - claude-opus-4-5-20251101 - anthropic/claude-opus-4-5-20251101 - claude-opus-4-6 - anthropic/claude-opus-4-6 - claude-sonnet-4-6 - anthropic/claude-sonnet-4-6 - claude-opus-4-1-latest - claude-opus-4-1 - anthropic/claude-opus-4.1-20250805 - claude-sonnet-4-5 - claude-haiku-4-5 - anthropic/claude-opus-4-5 - claude-opus-4-5 - anthropic/claude-sonnet-4-6-20260218 messages: anyOf: - type: array items: type: object properties: role: type: string enum: - user - assistant content: anyOf: - type: string - type: array items: oneOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - image source: oneOf: - type: object properties: type: type: string enum: - base64 description: The type of the image. media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp description: The media type of the image. data: type: string description: The base64 encoded image data. required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - thinking thinking: type: string signature: type: string required: - type - thinking - signature - type: object properties: type: type: string enum: - tool_result tool_use_id: type: string is_error: type: boolean content: anyOf: - type: string - type: array items: oneOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - image source: oneOf: - type: object properties: type: type: string enum: - base64 description: The type of the image. media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp description: The media type of the image. data: type: string description: The base64 encoded image data. required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - search_result source: type: string title: type: string content: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - title - content - type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - tool_reference tool_name: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_name cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - type: object properties: type: type: string enum: - tool_use id: type: string name: type: string input: type: object additionalProperties: {} caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - id - name - input - type: object properties: type: type: string enum: - server_tool_use id: type: string name: type: string enum: - web_search - web_fetch - code_execution - bash_code_execution - text_editor_code_execution - tool_search_tool_regex - tool_search_tool_bm25 input: type: object additionalProperties: {} caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - id - name - input - type: object properties: type: type: string enum: - search_result source: type: string title: type: string content: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - title - content - type: object properties: type: type: string enum: - web_search_tool_result tool_use_id: type: string content: anyOf: - type: array items: type: object properties: type: type: string enum: - web_search_result title: type: string url: type: string page_age: type: string encrypted_content: type: string required: - type - title - url - encrypted_content - type: object properties: type: type: string enum: - web_search_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - max_uses_exceeded - too_many_requests - query_too_long - request_too_large required: - type - error_code caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - web_fetch_tool_result tool_use_id: type: string content: anyOf: - type: object properties: type: type: string enum: - web_fetch_tool_result_error error_code: type: string enum: - invalid_tool_input - url_too_long - url_not_allowed - url_not_accessible - unsupported_content_type - too_many_requests - max_uses_exceeded - unavailable required: - type - error_code - type: object properties: type: type: string enum: - web_fetch_result url: type: string retrieved_at: type: string content: type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source required: - type - url - content caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - code_execution_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded required: - type - error_code - type: object properties: type: type: string enum: - code_execution_result stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - code_execution_output file_id: type: string required: - type - file_id required: - type - stdout - stderr - return_code - type: object properties: type: type: string enum: - encrypted_code_execution_result encrypted_stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - code_execution_output file_id: type: string required: - type - file_id required: - type - encrypted_stdout - stderr - return_code cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - bash_code_execution_tool_result tool_use_id: type: string content: anyOf: - type: object properties: type: type: string enum: - bash_code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded - output_file_too_large required: - type - error_code - type: object properties: type: type: string enum: - bash_code_execution_result stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - bash_code_execution_output file_id: type: string required: - type - file_id required: - type - stdout - stderr - return_code cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - text_editor_code_execution_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - text_editor_code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded - file_not_found error_message: type: string required: - type - error_code - type: object properties: type: type: string enum: - text_editor_code_execution_view_result content: type: string file_type: type: string enum: - text - image - pdf start_line: type: number num_lines: type: number total_lines: type: number required: - type - content - file_type - type: object properties: type: type: string enum: - text_editor_code_execution_create_result is_file_update: type: boolean required: - type - is_file_update - type: object properties: type: type: string enum: - text_editor_code_execution_str_replace_result old_start: type: number old_lines: type: number new_start: type: number new_lines: type: number lines: type: array items: type: string required: - type cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - tool_search_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - tool_search_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded required: - type - error_code - type: object properties: type: type: string enum: - tool_search_tool_search_result tool_references: type: array items: type: object properties: type: type: string enum: - tool_reference tool_name: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_name required: - type - tool_references cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - redacted_thinking data: type: string required: - type - data - type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source required: - role - content - type: array items: oneOf: - type: object properties: role: type: string enum: - system description: The role of the author of the message — in this case, the system. content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the system message. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - type: object properties: role: type: string enum: - user description: The role of the author of the message — in this case, the user content: anyOf: - type: string - type: array items: anyOf: - type: object properties: type: type: string enum: - image_url image_url: type: object properties: url: anyOf: - type: string format: uri - type: string description: 'Either a URL of the image or the base64 encoded image data. ' detail: type: string enum: - low - high - auto description: Specifies the detail level of the image. Currently supports JPG/JPEG, PNG, GIF, and WEBP formats. required: - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - image_url - type: object properties: type: type: string enum: - image source: type: object properties: type: type: string enum: - base64 media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp data: type: string required: - type - media_type - data cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - input_audio description: The type of the content part. input_audio: type: object properties: data: anyOf: - type: string format: uri - type: string - type: string description: Either a URL of the audio or the base64 encoded audio data. format: type: string enum: - wav - mp3 - audio/x-aac - audio/flac - audio/mp3 - audio/m4a - audio/mpeg - audio/mpga - audio/mp4 - audio/ogg - audio/pcm - audio/webm description: The format of the encoded audio data. Currently supports "wav" and "mp3". required: - data - format required: - type - input_audio - type: object properties: type: type: string enum: - file description: The type of the content part. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type file: type: object properties: file_data: type: string description: "The file data, encoded in base64 and passed to the model as a string. Only PDF format is supported.\n - Maximum size per file: Up to 512 MB and up to 2 million tokens.\n - Maximum number of files: Up to 20 files can be attached to a single GPT application or Assistant. This limit applies throughout the application's lifetime.\n - Maximum total file storage per user: 10 GB." file_id: type: string filename: type: string description: The file name specified by the user. This name can be used to reference the file when interacting with the model, especially if multiple files are uploaded. required: - type - file - type: object properties: type: type: string enum: - video_url video_url: type: object properties: url: anyOf: - type: string format: uri - type: string description: Base64-encoded local video file. required: - url required: - type - video_url description: The contents of the user message. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - type: object properties: role: type: string enum: - tool description: The role of the author of the message — in this case, the tool. content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the tool message. tool_call_id: type: string description: Tool call that this message is responding to. name: type: - string - 'null' description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - tool_call_id - type: object properties: role: type: string enum: - function content: type: string name: type: string required: - role - content - name - type: object properties: role: type: string enum: - assistant description: The role of the author of the message — in this case, the Assistant. content: anyOf: - type: string description: The contents of the Assistant message. - type: array items: anyOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: refusal: type: string description: The refusal message generated by the model. type: type: string enum: - refusal description: The type of the content part. required: - refusal - type description: An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal. - {} description: The contents of the Assistant message. Required unless tool_calls or function_call is specified. tool_calls: type: array items: oneOf: - type: object properties: id: type: string description: The ID of the tool call. type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: name: type: string description: The name of the function to call. arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments description: The function that the model called. extra_content: type: object additionalProperties: {} description: Opaque provider metadata for this tool call (e.g. Gemini thought_signature). Echo it back unchanged on the next turn. required: - id - type - function - type: object properties: id: type: string description: The ID of the tool call. type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: object properties: name: type: string description: The name of the custom tool to call. input: type: string description: The input for the custom tool call generated by the model. required: - name - input description: The custom tool that the model called. extra_content: type: object additionalProperties: {} description: Opaque provider metadata for this tool call (e.g. Gemini thought_signature). Echo it back unchanged on the next turn. required: - id - type - custom description: The tool calls generated by the model, such as function calls. reasoning_content: type: string refusal: type: - string - 'null' description: The refusal message by the Assistant. audio: type: - object - 'null' properties: id: type: string description: Unique identifier for a previous audio response from the model. required: - id description: Data about a previous audio response from the model. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - type: object properties: content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the developer message. role: type: string enum: - developer description: The role of the author of the message — in this case, the developer. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role description: A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, documents (txt, pdf), images, and audio. metadata: type: object additionalProperties: type: string description: An object describing metadata about the request stop_sequences: type: array items: type: string description: Custom text sequences that will cause the model to stop generating. stream: type: boolean default: false description: If set to True, the model response data will be streamed to the client as it is generated using server-sent events. system: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text default: text text: type: string citations: type: array items: oneOf: - type: object properties: type: type: string enum: - char_location cited_text: type: string document_index: type: number document_title: type: string end_char_index: type: number start_char_index: type: number required: - type - cited_text - document_index - document_title - end_char_index - start_char_index - type: object properties: type: type: string enum: - page_location cited_text: type: string document_index: type: number document_title: type: string end_page_number: type: number start_page_number: type: number required: - type - cited_text - document_index - document_title - end_page_number - start_page_number - type: object properties: type: type: string enum: - content_block_location cited_text: type: string document_index: type: number document_title: type: string end_block_index: type: number start_block_index: type: number required: - type - cited_text - document_index - document_title - end_block_index - start_block_index - type: object properties: type: type: string enum: - web_search_result_location cited_text: type: string encrypted_index: type: string title: type: string url: type: string required: - type - cited_text - encrypted_index - title - url - type: object properties: type: type: string enum: - search_result_location cited_text: type: string end_block_index: type: number search_result_index: type: number source: type: string start_block_index: type: number title: type: string required: - type - cited_text - end_block_index - search_result_index - source - start_block_index - title cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - text description: A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. tool_choice: anyOf: - type: object properties: type: type: string enum: - auto disable_parallel_tool_use: type: boolean required: - type - type: object properties: type: type: string enum: - any disable_parallel_tool_use: type: boolean required: - type - type: object properties: name: type: string type: type: string enum: - tool disable_parallel_tool_use: type: boolean required: - name - type - type: object properties: type: type: string enum: - none required: - type - type: object properties: type: type: string minLength: 1 required: - type - type: string enum: - none - auto - required description: none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: name: type: string description: The name of the function to call. required: - name required: - type - function description: Specifies a tool the model should use. Use to force the model to call a specific function. - type: object properties: type: type: string enum: - allowed_tools description: The type of the tool. Currently, only function is supported. allowed_tools: type: object properties: mode: type: string enum: - auto - required description: 'Constrains the tools available to the model to a pre-defined set. - auto allows the model to pick from among the allowed tools and generate a message. - required requires the model to call one or more of the allowed tools.' tools: type: array items: type: object additionalProperties: {} description: A list of tool definitions that the model should be allowed to call. required: - mode - tools required: - type - allowed_tools description: Constrains the tools available to the model to a pre-defined set. - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: string enum: - name description: The name of the function to call. required: - type - function description: Specifies a tool the model should use. Use to force the model to call a specific function. - type: object properties: type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: string enum: - name description: The name of the custom tool to call. required: - type - custom description: Specifies a tool the model should use. Use to force the model to call a specific custom tool. description: "Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {\"type\": \"function\", \"function\": {\"name\": \"my_function\"}} forces the model to call that tool.\n none is the default when no tools are present. auto is the default if tools are present." tools: anyOf: - type: array items: anyOf: - oneOf: - type: object properties: name: type: string description: Name of the tool. description: type: string description: "Description of what this tool does.\n Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema." input_schema: type: object properties: type: type: string enum: - object properties: {} required: type: array items: type: string required: - type additionalProperties: {} description: "JSON schema for this tool's input.\n This defines the shape of the input that your tool accepts and that the model will produce." type: type: string enum: - custom defer_loading: type: boolean eager_input_streaming: type: boolean input_examples: type: array items: type: object additionalProperties: {} strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - name - input_schema - type: object properties: name: type: string enum: - bash default: bash type: type: string enum: - bash_20250124 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20250522 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20250825 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20260120 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - memory default: memory type: type: string enum: - memory_20250818 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_editor default: str_replace_editor type: type: string enum: - text_editor_20250124 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_based_edit_tool default: str_replace_based_edit_tool type: type: string enum: - text_editor_20250429 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_based_edit_tool default: str_replace_based_edit_tool type: type: string enum: - text_editor_20250728 max_characters: type: number input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_search default: web_search type: type: string enum: - web_search_20250305 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string max_uses: type: number user_location: type: object properties: type: type: string enum: - approximate city: type: string country: type: string region: type: string timezone: type: string required: - type defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_search default: web_search type: type: string enum: - web_search_20260209 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string max_uses: type: number user_location: type: object properties: type: type: string enum: - approximate city: type: string country: type: string region: type: string timezone: type: string required: - type defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20250910 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20260209 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20260309 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - tool_search_tool_bm25 default: tool_search_tool_bm25 type: type: string enum: - tool_search_tool_bm25_20251119 - tool_search_tool_bm25 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - tool_search_tool_regex default: tool_search_tool_regex type: type: string enum: - tool_search_tool_regex_20251119 - tool_search_tool_regex defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: type: type: string minLength: 1 required: - type - type: array items: anyOf: - oneOf: - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: description: type: string description: A description of what the function does, used by the model to choose when and how to call the function. name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. parameters: type: object additionalProperties: description: The parameters the functions accepts, described as a JSON Schema object. strict: type: - boolean - 'null' description: Whether to enable strict schema adherence when generating the function call. If set to True, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is True. required: - name cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - function - type: object properties: type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: object properties: name: type: string description: The name of the custom tool, used to identify it in tool calls. description: type: string description: Optional description of the custom tool, used to provide more context. format: oneOf: - type: object properties: type: type: string enum: - text required: - type - type: object properties: type: type: string enum: - grammar grammar: type: object properties: definition: type: string description: The grammar definition. syntax: type: string enum: - lark - regex description: The syntax of the grammar definition. required: - definition - syntax required: - type - grammar description: The input format for the custom tool. Default is unconstrained text. required: - name - format cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - custom - type: object properties: type: type: string minLength: 1 required: - type description: "Definitions of tools that the model may use.\n If you include tools in your API request, the model may return tool_use content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using tool_result content blocks.\n Each tool definition includes:\n name: Name of the tool.\n description: Optional, but strongly-recommended description of the tool.\n input_schema: JSON schema for the tool input shape that the model will produce in tool_use output content blocks." thinking: anyOf: - oneOf: - type: object properties: type: type: string enum: - enabled budget_tokens: type: integer minimum: 1024 description: Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than max_tokens. display: type: string enum: - summarized - omitted default: summarized required: - type - budget_tokens - type: object properties: type: type: string enum: - disabled required: - type - type: object properties: type: type: string enum: - adaptive display: type: string enum: - summarized - omitted default: summarized required: - type - type: object properties: type: type: string minLength: 1 required: - type description: Configuration for enabling Claude's extended thinking. When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit. max_tokens: type: number default: 64000 description: The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. temperature: type: number minimum: 0 maximum: 1 description: Amount of randomness injected into the response. Defaults to 1.0. Ranges from 0.0 to 1.0. Use temperature closer to 0.0 for analytical / multiple choice, and closer to 1.0 for creative and generative tasks. Note that even with temperature of 0.0, the results will not be fully deterministic. top_p: type: number minimum: 0 maximum: 1 description: "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or temperature but not both." top_k: type: number minimum: 0 description: Only sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. Recommended for advanced use cases only. You usually only need to use temperature. required: - model - messages title: claude-opus-4-1-20250805, anthropic/claude-opus-4-1-20250805, claude-sonnet-4-5-20250929, anthropic/claude-sonnet-4-5-20250929, claude-haiku-4-5-20251001, anthropic/claude-haiku-4-5-20251001, claude-opus-4-5-20251101, anthropic/claude-opus-4-5-20251101, claude-opus-4-6, anthropic/claude-opus-4-6, claude-sonnet-4-6, anthropic/claude-sonnet-4-6, claude-opus-4-1-latest, claude-opus-4-1, anthropic/claude-opus-4.1-20250805, claude-sonnet-4-5, claude-haiku-4-5, anthropic/claude-opus-4-5, claude-opus-4-5, anthropic/claude-sonnet-4-6-20260218 - type: object properties: model: type: string enum: - claude-opus-4-7 - anthropic/claude-opus-4-7 - claude-opus-4-8 - anthropic/claude-opus-4-8 - claude-fable-5 - anthropic/claude-fable-5 - claude-sonnet-5 - anthropic/claude-sonnet-5 - claude-opus-5 - anthropic/claude-opus-5 - claude-opus-4.8-fast - anthropic/claude-opus-4.8-fast - claude-opus-4.8 - anthropic/claude-opus-4.8 - claude-opus-4.7-fast - anthropic/claude-opus-4.7-fast - claude-opus-4.7 - anthropic/claude-opus-4.7 - claude-sonnet-4.6 - anthropic/claude-sonnet-4.6 - claude-opus-4.6 - anthropic/claude-opus-4.6 - claude-opus-4.5 - anthropic/claude-opus-4.5 - claude-haiku-4.5 - anthropic/claude-haiku-4.5 - claude-sonnet-4.5 - anthropic/claude-sonnet-4.5 - claude-opus-4.1 - anthropic/claude-opus-4.1 - claude-opus-4 - anthropic/claude-opus-4 - claude-sonnet-4 - anthropic/claude-sonnet-4 - claude-3-haiku - anthropic/claude-3-haiku - anthropic/claude-fable-latest - claude-fable-latest - anthropic/claude-haiku-latest - claude-haiku-latest - anthropic/claude-sonnet-latest - claude-sonnet-latest - anthropic/claude-opus-latest - claude-opus-latest messages: anyOf: - type: array items: type: object properties: role: type: string enum: - user - assistant content: anyOf: - type: string - type: array items: oneOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - image source: oneOf: - type: object properties: type: type: string enum: - base64 description: The type of the image. media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp description: The media type of the image. data: type: string description: The base64 encoded image data. required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - thinking thinking: type: string signature: type: string required: - type - thinking - signature - type: object properties: type: type: string enum: - tool_result tool_use_id: type: string is_error: type: boolean content: anyOf: - type: string - type: array items: oneOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - image source: oneOf: - type: object properties: type: type: string enum: - base64 description: The type of the image. media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp description: The media type of the image. data: type: string description: The base64 encoded image data. required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - search_result source: type: string title: type: string content: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - title - content - type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - tool_reference tool_name: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_name cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - type: object properties: type: type: string enum: - tool_use id: type: string name: type: string input: type: object additionalProperties: {} caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - id - name - input - type: object properties: type: type: string enum: - server_tool_use id: type: string name: type: string enum: - web_search - web_fetch - code_execution - bash_code_execution - text_editor_code_execution - tool_search_tool_regex - tool_search_tool_bm25 input: type: object additionalProperties: {} caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - id - name - input - type: object properties: type: type: string enum: - search_result source: type: string title: type: string content: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - title - content - type: object properties: type: type: string enum: - web_search_tool_result tool_use_id: type: string content: anyOf: - type: array items: type: object properties: type: type: string enum: - web_search_result title: type: string url: type: string page_age: type: string encrypted_content: type: string required: - type - title - url - encrypted_content - type: object properties: type: type: string enum: - web_search_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - max_uses_exceeded - too_many_requests - query_too_long - request_too_large required: - type - error_code caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - web_fetch_tool_result tool_use_id: type: string content: anyOf: - type: object properties: type: type: string enum: - web_fetch_tool_result_error error_code: type: string enum: - invalid_tool_input - url_too_long - url_not_allowed - url_not_accessible - unsupported_content_type - too_many_requests - max_uses_exceeded - unavailable required: - type - error_code - type: object properties: type: type: string enum: - web_fetch_result url: type: string retrieved_at: type: string content: type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source required: - type - url - content caller: oneOf: - type: object properties: type: type: string enum: - direct required: - type - type: object properties: type: type: string enum: - code_execution_20250825 tool_id: type: string required: - type - tool_id - type: object properties: type: type: string enum: - code_execution_20260120 tool_id: type: string required: - type - tool_id cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - code_execution_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded required: - type - error_code - type: object properties: type: type: string enum: - code_execution_result stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - code_execution_output file_id: type: string required: - type - file_id required: - type - stdout - stderr - return_code - type: object properties: type: type: string enum: - encrypted_code_execution_result encrypted_stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - code_execution_output file_id: type: string required: - type - file_id required: - type - encrypted_stdout - stderr - return_code cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - bash_code_execution_tool_result tool_use_id: type: string content: anyOf: - type: object properties: type: type: string enum: - bash_code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded - output_file_too_large required: - type - error_code - type: object properties: type: type: string enum: - bash_code_execution_result stdout: type: string stderr: type: string return_code: type: number content: type: array items: type: object properties: type: type: string enum: - bash_code_execution_output file_id: type: string required: - type - file_id required: - type - stdout - stderr - return_code cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - text_editor_code_execution_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - text_editor_code_execution_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded - file_not_found error_message: type: string required: - type - error_code - type: object properties: type: type: string enum: - text_editor_code_execution_view_result content: type: string file_type: type: string enum: - text - image - pdf start_line: type: number num_lines: type: number total_lines: type: number required: - type - content - file_type - type: object properties: type: type: string enum: - text_editor_code_execution_create_result is_file_update: type: boolean required: - type - is_file_update - type: object properties: type: type: string enum: - text_editor_code_execution_str_replace_result old_start: type: number old_lines: type: number new_start: type: number new_lines: type: number lines: type: array items: type: string required: - type cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - tool_search_tool_result tool_use_id: type: string content: oneOf: - type: object properties: type: type: string enum: - tool_search_tool_result_error error_code: type: string enum: - invalid_tool_input - unavailable - too_many_requests - execution_time_exceeded required: - type - error_code - type: object properties: type: type: string enum: - tool_search_tool_search_result tool_references: type: array items: type: object properties: type: type: string enum: - tool_reference tool_name: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_name required: - type - tool_references cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - tool_use_id - content - type: object properties: type: type: string enum: - redacted_thinking data: type: string required: - type - data - type: object properties: type: type: string enum: - document source: oneOf: - type: object properties: type: type: string enum: - base64 media_type: type: string enum: - application/pdf - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - text media_type: type: string enum: - text/plain data: type: string required: - type - media_type - data - type: object properties: type: type: string enum: - url url: type: string format: uri required: - type - url - type: object properties: type: type: string enum: - content content: anyOf: - type: string - type: array items: {} required: - type - content title: type: string context: type: string cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source required: - role - content - type: array items: oneOf: - type: object properties: role: type: string enum: - system description: The role of the author of the message — in this case, the system. content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the system message. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - type: object properties: role: type: string enum: - user description: The role of the author of the message — in this case, the user content: anyOf: - type: string - type: array items: anyOf: - type: object properties: type: type: string enum: - image_url image_url: type: object properties: url: anyOf: - type: string format: uri - type: string description: 'Either a URL of the image or the base64 encoded image data. ' detail: type: string enum: - low - high - auto description: Specifies the detail level of the image. Currently supports JPG/JPEG, PNG, GIF, and WEBP formats. required: - url cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - image_url - type: object properties: type: type: string enum: - image source: type: object properties: type: type: string enum: - base64 media_type: type: string enum: - image/jpeg - image/png - image/gif - image/webp data: type: string required: - type - media_type - data cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - source - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: type: type: string enum: - input_audio description: The type of the content part. input_audio: type: object properties: data: anyOf: - type: string format: uri - type: string - type: string description: Either a URL of the audio or the base64 encoded audio data. format: type: string enum: - wav - mp3 - audio/x-aac - audio/flac - audio/mp3 - audio/m4a - audio/mpeg - audio/mpga - audio/mp4 - audio/ogg - audio/pcm - audio/webm description: The format of the encoded audio data. Currently supports "wav" and "mp3". required: - data - format required: - type - input_audio - type: object properties: type: type: string enum: - file description: The type of the content part. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type file: type: object properties: file_data: type: string description: "The file data, encoded in base64 and passed to the model as a string. Only PDF format is supported.\n - Maximum size per file: Up to 512 MB and up to 2 million tokens.\n - Maximum number of files: Up to 20 files can be attached to a single GPT application or Assistant. This limit applies throughout the application's lifetime.\n - Maximum total file storage per user: 10 GB." file_id: type: string filename: type: string description: The file name specified by the user. This name can be used to reference the file when interacting with the model, especially if multiple files are uploaded. required: - type - file - type: object properties: type: type: string enum: - video_url video_url: type: object properties: url: anyOf: - type: string format: uri - type: string description: Base64-encoded local video file. required: - url required: - type - video_url description: The contents of the user message. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - type: object properties: role: type: string enum: - tool description: The role of the author of the message — in this case, the tool. content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the tool message. tool_call_id: type: string description: Tool call that this message is responding to. name: type: - string - 'null' description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - content - tool_call_id - type: object properties: role: type: string enum: - function content: type: string name: type: string required: - role - content - name - type: object properties: role: type: string enum: - assistant description: The role of the author of the message — in this case, the Assistant. content: anyOf: - type: string description: The contents of the Assistant message. - type: array items: anyOf: - type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text - type: object properties: refusal: type: string description: The refusal message generated by the model. type: type: string enum: - refusal description: The type of the content part. required: - refusal - type description: An array of content parts with a defined type. Can be one or more of type text, or exactly one of type refusal. - {} description: The contents of the Assistant message. Required unless tool_calls or function_call is specified. tool_calls: type: array items: oneOf: - type: object properties: id: type: string description: The ID of the tool call. type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: name: type: string description: The name of the function to call. arguments: type: string description: The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. required: - name - arguments description: The function that the model called. extra_content: type: object additionalProperties: {} description: Opaque provider metadata for this tool call (e.g. Gemini thought_signature). Echo it back unchanged on the next turn. required: - id - type - function - type: object properties: id: type: string description: The ID of the tool call. type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: object properties: name: type: string description: The name of the custom tool to call. input: type: string description: The input for the custom tool call generated by the model. required: - name - input description: The custom tool that the model called. extra_content: type: object additionalProperties: {} description: Opaque provider metadata for this tool call (e.g. Gemini thought_signature). Echo it back unchanged on the next turn. required: - id - type - custom description: The tool calls generated by the model, such as function calls. reasoning_content: type: string refusal: type: - string - 'null' description: The refusal message by the Assistant. audio: type: - object - 'null' properties: id: type: string description: Unique identifier for a previous audio response from the model. required: - id description: Data about a previous audio response from the model. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - role - type: object properties: content: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text description: The type of the content part. text: type: string description: The text content. cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - text description: The contents of the developer message. role: type: string enum: - developer description: The role of the author of the message — in this case, the developer. name: type: string description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. required: - content - role description: A list of messages comprising the conversation so far. Depending on the model you use, different message types (modalities) are supported, like text, documents (txt, pdf), images, and audio. metadata: type: object additionalProperties: type: string description: An object describing metadata about the request stop_sequences: type: array items: type: string description: Custom text sequences that will cause the model to stop generating. stream: type: boolean default: false description: If set to True, the model response data will be streamed to the client as it is generated using server-sent events. system: anyOf: - type: string - type: array items: type: object properties: type: type: string enum: - text default: text text: type: string citations: type: array items: oneOf: - type: object properties: type: type: string enum: - char_location cited_text: type: string document_index: type: number document_title: type: string end_char_index: type: number start_char_index: type: number required: - type - cited_text - document_index - document_title - end_char_index - start_char_index - type: object properties: type: type: string enum: - page_location cited_text: type: string document_index: type: number document_title: type: string end_page_number: type: number start_page_number: type: number required: - type - cited_text - document_index - document_title - end_page_number - start_page_number - type: object properties: type: type: string enum: - content_block_location cited_text: type: string document_index: type: number document_title: type: string end_block_index: type: number start_block_index: type: number required: - type - cited_text - document_index - document_title - end_block_index - start_block_index - type: object properties: type: type: string enum: - web_search_result_location cited_text: type: string encrypted_index: type: string title: type: string url: type: string required: - type - cited_text - encrypted_index - title - url - type: object properties: type: type: string enum: - search_result_location cited_text: type: string end_block_index: type: number search_result_index: type: number source: type: string start_block_index: type: number title: type: string required: - type - cited_text - end_block_index - search_result_index - source - start_block_index - title cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - text description: A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. tool_choice: anyOf: - type: object properties: type: type: string enum: - auto disable_parallel_tool_use: type: boolean required: - type - type: object properties: type: type: string enum: - any disable_parallel_tool_use: type: boolean required: - type - type: object properties: name: type: string type: type: string enum: - tool disable_parallel_tool_use: type: boolean required: - name - type - type: object properties: type: type: string enum: - none required: - type - type: object properties: type: type: string minLength: 1 required: - type - type: string enum: - none - auto - required description: none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: name: type: string description: The name of the function to call. required: - name required: - type - function description: Specifies a tool the model should use. Use to force the model to call a specific function. - type: object properties: type: type: string enum: - allowed_tools description: The type of the tool. Currently, only function is supported. allowed_tools: type: object properties: mode: type: string enum: - auto - required description: 'Constrains the tools available to the model to a pre-defined set. - auto allows the model to pick from among the allowed tools and generate a message. - required requires the model to call one or more of the allowed tools.' tools: type: array items: type: object additionalProperties: {} description: A list of tool definitions that the model should be allowed to call. required: - mode - tools required: - type - allowed_tools description: Constrains the tools available to the model to a pre-defined set. - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: string enum: - name description: The name of the function to call. required: - type - function description: Specifies a tool the model should use. Use to force the model to call a specific function. - type: object properties: type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: string enum: - name description: The name of the custom tool to call. required: - type - custom description: Specifies a tool the model should use. Use to force the model to call a specific custom tool. description: "Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {\"type\": \"function\", \"function\": {\"name\": \"my_function\"}} forces the model to call that tool.\n none is the default when no tools are present. auto is the default if tools are present." tools: anyOf: - type: array items: anyOf: - oneOf: - type: object properties: name: type: string description: Name of the tool. description: type: string description: "Description of what this tool does.\n Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema." input_schema: type: object properties: type: type: string enum: - object properties: {} required: type: array items: type: string required: - type additionalProperties: {} description: "JSON schema for this tool's input.\n This defines the shape of the input that your tool accepts and that the model will produce." type: type: string enum: - custom defer_loading: type: boolean eager_input_streaming: type: boolean input_examples: type: array items: type: object additionalProperties: {} strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - name - input_schema - type: object properties: name: type: string enum: - bash default: bash type: type: string enum: - bash_20250124 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20250522 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20250825 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - code_execution default: code_execution type: type: string enum: - code_execution_20260120 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - memory default: memory type: type: string enum: - memory_20250818 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_editor default: str_replace_editor type: type: string enum: - text_editor_20250124 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_based_edit_tool default: str_replace_based_edit_tool type: type: string enum: - text_editor_20250429 input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - str_replace_based_edit_tool default: str_replace_based_edit_tool type: type: string enum: - text_editor_20250728 max_characters: type: number input_examples: type: array items: type: object additionalProperties: {} defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_search default: web_search type: type: string enum: - web_search_20250305 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string max_uses: type: number user_location: type: object properties: type: type: string enum: - approximate city: type: string country: type: string region: type: string timezone: type: string required: - type defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_search default: web_search type: type: string enum: - web_search_20260209 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string max_uses: type: number user_location: type: object properties: type: type: string enum: - approximate city: type: string country: type: string region: type: string timezone: type: string required: - type defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20250910 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20260209 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - web_fetch default: web_fetch type: type: string enum: - web_fetch_20260309 allowed_domains: type: array items: type: string blocked_domains: type: array items: type: string citations: type: object properties: enabled: type: boolean max_content_tokens: type: number max_uses: type: number defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - tool_search_tool_bm25 default: tool_search_tool_bm25 type: type: string enum: - tool_search_tool_bm25_20251119 - tool_search_tool_bm25 defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: name: type: string enum: - tool_search_tool_regex default: tool_search_tool_regex type: type: string enum: - tool_search_tool_regex_20251119 - tool_search_tool_regex defer_loading: type: boolean strict: type: boolean allowed_callers: type: array items: type: string enum: - direct - code_execution_20250825 - code_execution_20260120 cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - type: object properties: type: type: string minLength: 1 required: - type - type: array items: anyOf: - oneOf: - type: object properties: type: type: string enum: - function description: The type of the tool. Currently, only function is supported. function: type: object properties: description: type: string description: A description of what the function does, used by the model to choose when and how to call the function. name: type: string description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. parameters: type: object additionalProperties: description: The parameters the functions accepts, described as a JSON Schema object. strict: type: - boolean - 'null' description: Whether to enable strict schema adherence when generating the function call. If set to True, the model will follow the exact schema defined in the parameters field. Only a subset of JSON Schema is supported when strict is True. required: - name cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - function - type: object properties: type: type: string enum: - custom description: The type of the tool. Currently, only function is supported. custom: type: object properties: name: type: string description: The name of the custom tool, used to identify it in tool calls. description: type: string description: Optional description of the custom tool, used to provide more context. format: oneOf: - type: object properties: type: type: string enum: - text required: - type - type: object properties: type: type: string enum: - grammar grammar: type: object properties: definition: type: string description: The grammar definition. syntax: type: string enum: - lark - regex description: The syntax of the grammar definition. required: - definition - syntax required: - type - grammar description: The input format for the custom tool. Default is unconstrained text. required: - name - format cache_control: type: object properties: type: type: string enum: - ephemeral ttl: type: string enum: - 5m - 1h required: - type required: - type - custom - type: object properties: type: type: string minLength: 1 required: - type description: "Definitions of tools that the model may use.\n If you include tools in your API request, the model may return tool_use content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using tool_result content blocks.\n Each tool definition includes:\n name: Name of the tool.\n description: Optional, but strongly-recommended description of the tool.\n input_schema: JSON schema for the tool input shape that the model will produce in tool_use output content blocks." thinking: anyOf: - oneOf: - type: object properties: type: type: string enum: - enabled budget_tokens: type: integer minimum: 1024 description: Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than max_tokens. display: type: string enum: - summarized - omitted default: summarized required: - type - budget_tokens - type: object properties: type: type: string enum: - disabled required: - type - type: object properties: type: type: string enum: - adaptive display: type: string enum: - summarized - omitted default: summarized required: - type - type: object properties: type: type: string minLength: 1 required: - type description: Configuration for enabling Claude's extended thinking. When enabled, responses include thinking content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your max_tokens limit. max_tokens: type: number default: 128000 description: The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API. required: - model - messages title: claude-opus-4-7, anthropic/claude-opus-4-7, claude-opus-4-8, anthropic/claude-opus-4-8, claude-fable-5, anthropic/claude-fable-5, claude-sonnet-5, anthropic/claude-sonnet-5, claude-opus-5, anthropic/claude-opus-5, claude-opus-4.8-fast, anthropic/claude-opus-4.8-fast, claude-opus-4.8, anthropic/claude-opus-4.8, claude-opus-4.7-fast, anthropic/claude-opus-4.7-fast, claude-opus-4.7, anthropic/claude-opus-4.7, claude-sonnet-4.6, anthropic/claude-sonnet-4.6, claude-opus-4.6, anthropic/claude-opus-4.6, claude-opus-4.5, anthropic/claude-opus-4.5, claude-haiku-4.5, anthropic/claude-haiku-4.5, claude-sonnet-4.5, anthropic/claude-sonnet-4.5, claude-opus-4.1, anthropic/claude-opus-4.1, claude-opus-4, anthropic/claude-opus-4, claude-sonnet-4, anthropic/claude-sonnet-4, claude-3-haiku, anthropic/claude-3-haiku, anthropic/claude-fable-latest, claude-fable-latest, anthropic/claude-haiku-latest, claude-haiku-latest, anthropic/claude-sonnet-latest, claude-sonnet-latest, anthropic/claude-opus-latest, claude-opus-latest - type: object properties: model: type: string enum: - test/dummy-breaker - dummy-breaker - test/dummy messages: type: array items: {} minItems: 1 max_tokens: type: integer minimum: 1 system: anyOf: - type: string - type: array items: {} stream: type: boolean test: type: object properties: credits: type: number delay: type: number errorStatus: type: number required: - model - messages - max_tokens title: test/dummy-breaker, dummy-breaker, test/dummy responses: '200': content: application/json: schema: type: object properties: {} text/event-stream: schema: type: object properties: {} tags: - Messages summary: V1 messages x-summary-source: derived